-
Notifications
You must be signed in to change notification settings - Fork 34
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
Ensure only one copy of a cronjob can run at a time #172
Comments
I like this idea a lot. It gets Lagoon to address the concurrency issue, rather than requiring all codebases do it. Additional thoughts:
$ echo "$command" | sha256sum | awk '{ print $1 }'
e4206b8e5676ba55d13203d06fe9004ff1e2bb848d74d0c7daac1ea0cafdf30b
$ echo "$command" | sha256sum | awk '{ print $1 }' | cut -c 1-8
e4206b8e
So perhaps: /lagoon/entrypoints.sh flock --verbose -n /tmp/cron-$(echo "$@" | sha256sum | awk '{ print $1 }' | cut -c 1-8).lock sh -c "$@" |
thanks for the feedback 😄
I'm not sure about this. it's only every meant to be machine readable and there doesn't seem to be much point in adding another command to the pipeline for aesthetics.
I'm not sure I understand this. The file already is named
Unfortunately this is GNU specific. Busybox |
lagoon-images/images/commons/lagoon/cronjob.sh
Line 14 in 3a9f7d2
To avoid issues with cronjobs piling up we should use
flock
here. Something like this (untested):The text was updated successfully, but these errors were encountered: