Can't purge named datasets

When I crate a named dataset like const dataset = await Dataset.open("test"); and let the script run the data gets appended after each run. I tried to call purgeDefaultStorages() but this has no effect. What am I doing wrong?
2 Replies
optimistic-gold
optimistic-gold•3y ago
named dataset is not default storage, you need to https://crawlee.dev/api/core/class/Dataset#drop from your code
other-emerald
other-emerald•3y ago
I solved this issue by changing the default folder itself per crawler. 😆 something like
const spider: string = easy.opts('spider')
process.env.CRAWLEE_STORAGE_DIR = `./storage/${spider}
const spider: string = easy.opts('spider')
process.env.CRAWLEE_STORAGE_DIR = `./storage/${spider}

Did you find this page helpful?