Skip to content

Commit

Permalink
fix(eventsub): fix max timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Mar 18, 2023
1 parent 219b4de commit 0e38a53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/twitch/eventsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class EventSub {
this.listener = new EventSubWsListener({
apiClient,
logger: {
minLevel: isDebugEnabled('eventsub') ? 'trace' : undefined,
minLevel: isDebugEnabled('twitch.eventsub') ? 'trace' : undefined,
custom: (level, message) => {
info(`EVENTSUB-WS[${level}]: ${message}`);
},
Expand Down Expand Up @@ -79,7 +79,7 @@ class EventSub {
}
error(`EVENTSUB-WS: ${err ?? 'Unknown error'}`);
this.listener?.stop();
const maxTimeout = 2 / DAY;
const maxTimeout = DAY / 2;
const nextTimeout = initialTimeout * 2;
initialTimeout = Math.min(nextTimeout, maxTimeout);
info(`EVENTSUB-WS: Reconnecting in ${humanizeDuration(initialTimeout)}...`);
Expand Down

0 comments on commit 0e38a53

Please sign in to comment.