mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-30 08:31:16 +00:00
[core] Add more debugging for eventsub subscriptions
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
30c2246f25
commit
facd2e7b91
1 changed files with 10 additions and 0 deletions
|
@ -324,6 +324,11 @@ func (e *EventSubClient) PreFetchSubscriptions(ctx context.Context) error {
|
||||||
return errors.Wrap(err, "hashing condition")
|
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}, "::")
|
cacheKey := strings.Join([]string{sub.Type, condHash}, "::")
|
||||||
e.subscriptions[cacheKey] = ®isteredSubscription{
|
e.subscriptions[cacheKey] = ®isteredSubscription{
|
||||||
Type: sub.Type,
|
Type: sub.Type,
|
||||||
|
@ -363,6 +368,11 @@ func (e *EventSubClient) RegisterEventSubHooks(event string, condition EventSubC
|
||||||
return func() { e.unregisterCallback(cacheKey, cbKey) }, nil
|
return func() { e.unregisterCallback(cacheKey, cbKey) }, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.WithFields(log.Fields{
|
||||||
|
"condition": condition,
|
||||||
|
"type": event,
|
||||||
|
}).Debug("registering new eventsub subscription")
|
||||||
|
|
||||||
// Register subscriptions
|
// Register subscriptions
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), twitchRequestTimeout)
|
ctx, cancel := context.WithTimeout(context.Background(), twitchRequestTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
Loading…
Reference in a new issue