[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
0

Configure Feed

Select the types of activity you want to include in your feed.

refactor(logging): Reduce noise for polling interval logging

FoxxMD (Apr 10, 2024, 10:19 AM EDT) 0572d6a3 5967e3df

+4 -6
+4 -6
src/backend/sources/AbstractSource.ts
··· 517 517 const activeThreshold = this.lastActivityAt.add(checkActiveFor, 's'); 518 518 const inactiveFor = dayjs.duration(Math.abs(activeThreshold.diff(dayjs(), 'millisecond'))).humanize(false); 519 519 if (activeThreshold.isBefore(dayjs())) { 520 + let intervalStr: string = formatNumber(maxInterval); 520 521 checksOverThreshold++; 521 522 if(sleepTime < maxInterval) { 522 523 const checkVal = Math.min(checksOverThreshold, 1000); 523 524 const backoff = Math.round(Math.max(Math.min(Math.min(checkVal, 1000) * 2 * (1.1 * checkVal), maxBackoff), 5)); 525 + intervalStr = `(${interval} + ${backoff})`; 524 526 sleepTime = interval + backoff; 525 - this.logger.debug(`Last activity was at ${this.lastActivityAt.format()} which is ${inactiveFor} outside of active polling period of (last activity + ${checkActiveFor} seconds). Will check again in interval ${interval} + ${backoff} seconds.`); 526 - } else { 527 - this.logger.debug(`Last activity was at ${this.lastActivityAt.format()} which is ${inactiveFor} outside of active polling period of (last activity + ${checkActiveFor} seconds). Will check again in max interval ${maxInterval} seconds.`); 528 527 } 528 + this.logger.debug(`Last activity ${this.lastActivityAt.format()} is ${inactiveFor} outside of polling period (last activity + ${checkActiveFor}s) | Next check interval: ${intervalStr}s`); 529 529 } else { 530 - this.logger.debug(`Last activity was at ${this.lastActivityAt.format()}. Will check again in interval ${formatNumber(sleepTime)} seconds.`); 530 + this.logger.debug(`Last activity was at ${this.lastActivityAt.format()} | Next check interval: ${formatNumber(sleepTime)}s`); 531 531 } 532 - 533 - this.logger.verbose(`Sleeping for ${formatNumber(sleepTime)}s`); 534 532 const wakeUpAt = pollFrom.add(sleepTime, 'seconds'); 535 533 while(!this.shouldStopPolling() && dayjs().isBefore(wakeUpAt)) { 536 534 // check for polling status every half second and wait till wake up time