Hi fly community!
I am working on a project that runs background jobs that can take several minutes (+5 minutes), my implementation is more or less something like this:
- VM running Hono.dev that has an endpoint for triggering a background job when called
- When the job is running it spins up chromium with puppeteer and it starts crawling the content of hundreds/thousands of web pages (sometimes it takes 1 minute, sometimes it can take 10).
What is the problem?
After some time of no HTTP activity the hono server goes to sleep/scale down, (this is Fly’s natural behaviour), even though the background job it’s still running and doing some operations, this kills the chromium instance and everything starts to fail.
Is there a correct way to do configure a Fly VM to not go to sleep if there is a job running?