Skip to content

Commit

Permalink
chore: move lookup loop logging to lower level (#2784)
Browse files Browse the repository at this point in the history
Changing this makes it so it doesn't spam hundreds of messages per second making debug log unreadable.
  • Loading branch information
AlexP11223 authored Oct 7, 2021
1 parent 73eaa88 commit a20faaa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/store/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,18 +560,18 @@ async function runCaptchaDeterrent(browser: Browser, store: Store, page: Page) {

export async function tryLookupAndLoop(browser: Browser, store: Store) {
if (!browser.isConnected()) {
logger.debug(`[${store.name}] Ending this loop as browser is disposed...`);
logger.silly(`[${store.name}] Ending this loop as browser is disposed...`);
return;
}

logger.debug(`[${store.name}] Starting lookup...`);
logger.silly(`[${store.name}] Starting lookup...`);
try {
await lookup(browser, store);
} catch (error: unknown) {
logger.error(error);
}

const sleepTime = getSleepTime(store);
logger.debug(`[${store.name}] Lookup done, next one in ${sleepTime} ms`);
logger.silly(`[${store.name}] Lookup done, next one in ${sleepTime} ms`);
setTimeout(tryLookupAndLoop, sleepTime, browser, store);
}

0 comments on commit a20faaa

Please sign in to comment.