Skip to content

Commit

Permalink
chore: change info to error and remove duplicate log
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Jul 17, 2024
1 parent 2162263 commit 2b3ead4
Showing 1 changed file with 5 additions and 11 deletions.
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

0 comments on commit 2b3ead4

Please sign in to comment.