Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change info to error and remove duplicate log #94

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions internal/nostr/nostr.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func (svc *Service) NIP47Handler(c echo.Context) error {
"request_event_id": requestData.SignedEvent.ID,
"wallet_pubkey": requestData.WalletPubkey,
"relay_url": requestData.RelayUrl,
}).Info("Stopped subscription without receiving event")
}).Error("Stopped subscription without receiving event")
if ctx.Err() == context.DeadlineExceeded {
return c.JSON(http.StatusGatewayTimeout, ErrorResponse{
Message: "Request timed out",
Expand All @@ -373,12 +373,6 @@ func (svc *Service) NIP47Handler(c echo.Context) error {
Error: ctx.Err().Error(),
})
case event := <-subscription.EventChan:
svc.Logger.WithFields(logrus.Fields{
"request_event_id": requestData.SignedEvent.ID,
"response_event_id": event.ID,
"wallet_pubkey": requestData.WalletPubkey,
"relay_url": requestData.RelayUrl,
}).Info("Received response event")
return c.JSON(http.StatusOK, NIP47Response{
Event: event,
State: EVENT_PUBLISHED,
Expand Down Expand Up @@ -789,10 +783,10 @@ func (svc *Service) publishEvent(ctx context.Context, subscription *Subscription

func (svc *Service) handleResponseEvent(event *nostr.Event, subscription *Subscription) {
svc.Logger.WithFields(logrus.Fields{
"event_id": event.ID,
"event_kind": event.Kind,
"request_event_id": subscription.RequestEvent.ID,
"wallet_pubkey": svc.getWalletPubkey(subscription.Authors),
"response_event_id": event.ID,
"request_event_id": subscription.RequestEvent.ID,
"wallet_pubkey": svc.getWalletPubkey(subscription.Authors),
"relay_url": subscription.RelayUrl,
}).Info("Received response event")
responseEvent := ResponseEvent{
NostrId: event.ID,
Expand Down
Loading