Skip to content

Commit

Permalink
[core] Add more debugging for eventsub subscriptions
Browse files Browse the repository at this point in the history
Signed-off-by: Knut Ahlers <[email protected]>
  • Loading branch information
Luzifer committed Dec 24, 2022
1 parent 30c2246 commit facd2e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/twitch/eventsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ func (e *EventSubClient) PreFetchSubscriptions(ctx context.Context) error {
return errors.Wrap(err, "hashing condition")
}

log.WithFields(log.Fields{
"condition": sub.Condition,
"type": sub.Type,
}).Debug("found existing eventsub subscription")

cacheKey := strings.Join([]string{sub.Type, condHash}, "::")
e.subscriptions[cacheKey] = &registeredSubscription{
Type: sub.Type,
Expand Down Expand Up @@ -363,6 +368,11 @@ func (e *EventSubClient) RegisterEventSubHooks(event string, condition EventSubC
return func() { e.unregisterCallback(cacheKey, cbKey) }, nil
}

log.WithFields(log.Fields{
"condition": condition,
"type": event,
}).Debug("registering new eventsub subscription")

// Register subscriptions
ctx, cancel := context.WithTimeout(context.Background(), twitchRequestTimeout)
defer cancel()
Expand Down

0 comments on commit facd2e7

Please sign in to comment.