Is there a way to create Worker that cleans itself up if there is a successful exit?

I have some jobs that I am launching using the Koyeb API every few hours. For now I have written a cleaner that cleans it up after its reports itself as finished either way.

These are background workers that finish succesfully or fail; currently Koyeb keeps restarting the the service even when it has an exit code 0; till my cleanup service cleans it.

I also receive an email that says the deployment failed. Can I just launch a job that cleans itself if it finishes with exit code0?

Hi @Gyanendra_Mishra,

We have plans to add support for jobs, it’s on our Roadmap, but I cannot give any ETA yet.

Regards

Thank you Lukasz. I just wanted to be sure I am not overlooking a feature that exists.

Is it long-running jobs?

If it’s a short job triggered from an HTTP API, scale-to-zero, which is going to be released in the coming days, might be an option.

These are short jobs. Essentially ingestion jobs for our customers data that run normally for less than 30 minutes. I just found it easier to do this via the Koyeb API than set up and maintain a separate k8s cluster; scale to zero could work well for me!