#change storage dir programaticly

1 messages · Page 1 of 1 (latest)

grand talon
#

Hi All,

I want to use crawlee in kubernetes. I want my jobs to be resumable if a pod gets evicted so I have set up a PV for storage. This however poses an issue if I have multiple pods running at once. To solve this I want to change the storage dir programaticly when instanciating crawlee. I know I can do this through ENV vars however id prefer a more programatic solution if possible?

I have looked at the constructors for the (Playwright) Crawler and the Configuration class but I dont seem to be able to set it.

Thanks!

lime nymph
dense valley
#

You can define storageClientOptions in the Configuration constructor, where you can use the MemoryStorageOptions, see the links above. Then, you can pass the Configuration object to the crawler constructor.