Repository navigation
docker: run the scheduled sync once, not twice - #29
Merged
Merged
Conversation
The crontab was written to /etc/cron.d and then installed again with crontab. dcron reads /etc/cron.d on its own, so the job was registered twice and every sync ran as two processes at once. The file now lives in /app, so only the installed copy exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The scheduled sync has been running twice at once; this makes it run once.
Why: every sync slot did the same work as two concurrent processes: double the GitHub API calls, and two writers stamping the same project items at the same time.
The crontab was registered twice.
entry.shwrites the crontab to/etc/cron.d/crontaband then installs it withcrontab. Alpine's dcron also reads/etc/cron.dby itself, so it saw the job in both places. A once-a-minute job in a plain Alpine container with those exact lines fires twice in the same second:The file now lives in
/app, so only the copycrontabinstalls exists; the same test fires once a minute.Fine as it is: the rest of
entry.sh(the env copy, the log tail) is unchanged; shellcheck passes.