For now, solved it in a very hacky, but convenient way :))
Thx for the idea
Crawler options
failedRequestHandler: async (context, error) => {
if (os.platform() === `darwin`) {
const {request} = context
fs.writeFileSync(debugFilePath, JSON.stringify(request, null, 2))
console.log(`Stored failed request to ${debugFilePath}, if not deleted, it will be used for request list the next time you run the actor.`)
}
}
During my custom init
if (os.platform() === `darwin`) {
const files = fs.readdirSync(debugDir).filter(file => file.endsWith(`.json`))
// for (const file of files) {
// const request = JSON.parse(fs.readFileSync(filePath, `utf8`))
await crawler.run(requests)
}