Running scheduled jobs with python app after VM restarts

Hi! Maybe this is the wrong interpretation but wanted to ask regardless.
As I understand it I can have fly deploy to processes of my app (say a python fastapi api and a worker that uses celery)
All that works fine and I can send requests from my fast api to my celery worker.

Now, I’m building support for scheduled jobs, where a user can submit a query in the api and the celery worker will essentially create a new cron job for that request that will run at a specific cadence.
Because I’m using the shared-vms I wonder, if my app is restarted/redeployed, everything in that VM gets “wiped” and restarted. Would the cron jobs also get wiped?

Essentially, I’m trying to understand how I can build scheduled jobs in fly so that if an app is restarted because of a deployment, the scheduled jobs still run.

Maybe the suggestion here is to run some code when the app restarts to check the scheduled jobs from a db and create new cron jobs when the app restarts from the state of the db? Seems complicated

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.