Skip to content

Commit

Permalink
feat: clear cookies and cache (#515)
Browse files Browse the repository at this point in the history
Fixes #417
  • Loading branch information
eckig committed Oct 13, 2020
1 parent f24f565 commit 1f89945
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/store/lookup.ts
Expand Up @@ -53,6 +53,9 @@ async function lookup(browser: Browser, store: Store) {
statusCode = await lookupCard(browser, store, page, link);
} catch (error) {
logger.error(`✖ [${store.name}] ${link.brand} ${link.series} ${link.model} - ${error.message as string}`);
const client = await page.target().createCDPSession();
await client.send('Network.clearBrowserCookies');
await client.send('Network.clearBrowserCache');
}

// Must apply backoff before closing the page, e.g. if CloudFlare is
Expand Down

0 comments on commit 1f89945

Please sign in to comment.