feat: Configurable poll rate for check-for-changes.sh#4450
feat: Configurable poll rate for check-for-changes.sh#4450casperklein merged 8 commits intodocker-mailserver:masterfrom litetex:check-for-changes-configurable-sleep
check-for-changes.sh#4450Conversation
polarathene
left a comment
There was a problem hiding this comment.
Thanks for the PR :)
We have _POLL for Getmail and Fetchmail services, I think we can be consistent with that suffix.
Likewise DMS_ as a prefix to remove ambiguity. "Check for changes" is a legacy name, as the feature hasn't been officially documented yet we can just refer to it as "change detection". Retaining the script name reference in the changelog is fine though, added a link to the relevant docs page for more context (such as the default).
| while true; do | ||
| _check_for_changes | ||
| sleep 2 | ||
| sleep ${CHECK_FOR_CHANGES_INTERVAL_SEC:-20} |
There was a problem hiding this comment.
| sleep ${CHECK_FOR_CHANGES_INTERVAL_SEC:-20} | |
| sleep ${DMS_CONFIG_POLL:-2} |
Pretty sure if the default is left at 20 it'll affect our CI tests without having the ENV updated there to reduce it.
While I understand wanting to have a more sane default than 2, this would negatively impact new users trying to setup their DMS instance based on our docs with the setup CLI, having to wait up to 20 seconds until the update is actually applied (the CLI will not wait, it updates the monitored config, then defers to check-for-changes.sh). As such it'd also be breaking for any automation reliant upon that existing default (like our CI).
Your main concern would be completely avoided should someone contribute watchexec, which for the majority of users would remove any polling entirely.
The other maintainers may request that this ENV is also handled here:
docker-mailserver/target/scripts/startup/variables-stack.sh
Lines 50 to 53 in ef66dd5
That's where defaults are usually set (and written to /etc/dms-settings), but since this is specifically for check-for-changes.sh and not likely to be prone to breakage/conflict, I'm not going to require it.
There was a problem hiding this comment.
The other maintainers may request that this ENV is also handled here:
docker-mailserver/target/scripts/startup/variables-stack.sh
Lines 50 to 53 in ef66dd5
That's where defaults are usually set (and written to
/etc/dms-settings), but since this is specifically forcheck-for-changes.shand not likely to be prone to breakage/conflict, I'm not going to require it.
For completeness, please add the new ENV to the list.
Co-authored-by: Brennan Kinney <[email protected]>
* ENV var renamed * Default line changed to match the format used with other poll ENV. * Rewrote the description with reference links so users have better insight. Co-authored-by: Brennan Kinney <[email protected]>
Pretty sure if the default is left at 20 it'll affect our CI tests without having the ENV updated there to reduce it. While I understand wanting to have a more sane default than `2`, this would negatively impact new users trying to setup their DMS instance based on our docs with the `setup` CLI, having to wait up to 20 seconds until the update is actually applied (_the CLI will not wait, it updates the monitored config, then defers to `check-for-changes.sh`_). As such it'd also be breaking for any automation reliant upon that existing default (like our CI). Co-authored-by: Brennan Kinney <[email protected]>
|
Thank you for the feedback. I applied you changes accordingly :) |
Co-authored-by: Casper <[email protected]>
|
Oh whoops, I applied the change suggestion from @casperklein before noticing his other feedback 😓 @litetex feel free to force push your own branch or pull that change and then commit the other change request. LGTM thus far though 👍 |
check-for-changes.sh execution intervalcheck-for-changes.sh
|
Documentation preview for this PR is ready! 🎉 Built with commit: bd76310 |
Description
Makes the
check-for-changes.shexecution interval configurable (see issue for details).Picked a default value of
20becauseFixes #4414
Type of change
Checklist
docs/)CHANGELOG.md