Skip to content

Commit

Permalink
fix: improve err handling and remove check
Browse files Browse the repository at this point in the history
  • Loading branch information
frnandu committed Oct 25, 2024
1 parent d0b0354 commit 0c5949c
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions service/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,20 @@ func (s *createAppSubscriber) ConsumeEvent(ctx context.Context, event *events.Ev
if err != nil {
logger.Logger.WithError(err).Error("Failed to calculate app wallet priv key")
}
walletPubKey, _ := nostr.GetPublicKey(walletPrivKey)

if walletPubKey != "" {
go func() {
err = s.svc.startAppWalletSubscription(ctx, s.relay, walletPubKey, walletPrivKey)
if err != nil {
logger.Logger.WithError(err).WithFields(logrus.Fields{
"app_id": id}).Error("Failed to subscribe to wallet")
}
logger.Logger.WithFields(logrus.Fields{
"app_id": id}).Info("App Nostr Subscription ended")
}()
walletPubKey, err := nostr.GetPublicKey(walletPrivKey)
if err != nil {
logger.Logger.WithError(err).Error("Failed to calculate app wallet pub key")
}

go func() {
err = s.svc.startAppWalletSubscription(ctx, s.relay, walletPubKey, walletPrivKey)
if err != nil {
logger.Logger.WithError(err).WithFields(logrus.Fields{
"app_id": id}).Error("Failed to subscribe to wallet")
}
logger.Logger.WithFields(logrus.Fields{
"app_id": id}).Info("App Nostr Subscription ended")
}()
}

type deleteAppSubscriber struct {
Expand Down

0 comments on commit 0c5949c

Please sign in to comment.