Hey, how do you code cron job?
I am using playwright and using same code like you. But it always show all request completed after frist run.
It looks like it cahced the completed url somewhere. But I don't find related config or function to handle cache in document.
I tried
crawler.teardown()
and no luck, since its description is
Function for cleaning up after all requests are processed.
.
Cron('*/10 * * * * *', async () => {
const crawler = new PlaywrightCrawler({
requestHandler: odHandler,
})
await crawler.run([process.env.OD_URL])
})
INFO PlaywrightCrawler: Initializing the crawler.
INFO PlaywrightCrawler: All requests from the queue have been processed, the crawler will shut down.
INFO PlaywrightCrawler: Final request statistics: {"requestsFinished":0,"requestsFailed":0,"retryHistogram":[],"requestAvgFailedDurationMillis":null,"requestAvgFinishedDurationMillis":null,"requestsFinishedPerMinute":0,"requestsFailedPerMinute":0,"requestTotalDurationMillis":0,"requestsTotal":0,"crawlerRuntimeMillis":192}
INFO PlaywrightCrawler: Finished! Total 0 requests: 0 succeeded, 0 failed. {"terminal":true}