Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep the command running until it finishes even if there was an update to the service. #270

Open
osamaAbdullah opened this issue Jun 26, 2023 · 2 comments

Comments

@osamaAbdullah
Copy link

Description

In my use case, I have an hourly cron job "9 * * * *" It takes 10 minutes to finish if the image is updated during the execution time then the command will be stopped and interrupted.

The request is to give the possibility to apply the updates only on the new runs and keep the old instances untouched.

Example:

  • service started at 10:9 AM
  • service got updated at 10:11 AM

then the command will stop and updates will be applied in the next run

@crazy-max
Copy link
Owner

You need to set the label swarm.cronjob.skip-running=true: https://crazymax.dev/swarm-cronjob/usage/docker-labels/#docker-labels

@osamaAbdullah
Copy link
Author

osamaAbdullah commented Jun 27, 2023

swarm.cronjob.skip-running=true This label is not handling my use case it's for a different use case: if a task is already running and another one is triggered before the first one is finished it will ignore the second one.

my case is: when a service is running and it gets updated by the swarm keep it running until it finishes for the next run and apply the new updates. (Currently the changes are applied immediately and the running task will be stoped!)

@crazy-max

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants