Add -t option to ignore too old cronjob active flag #2669
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds
-t TIME_IN_SEC
option into the shell scripts for cronjobs.Example usage:
run-statistics.sh -t 3600
I have had some experiences that cronjob didn't finished properly (e.g., due to connection interruption of DB or coind) and
${cron_name}_active
left1
. It causes keeping the job from running in next execution until I note it and manually remove the flag by running the job with-f
option. The miners had inconvenience suchs as no credits added or no cash outs for a long time.With this
-t
option, the jobs ignore the active flag if the last job was started before than the user specified by this option. For example,-t 3600
ignores the flag if it was started more than one hours ago. Note the option ignores PID file created by the shell script. By this option the cronjobs can automatically recovered from such a situation.