forked from memcached/memcached
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a system for periodically running functions in the configuration thread. These crons may also signal to reload the configuration after they run. IE: you may shell out or run a module to fetch and download new json data, then reload the configuration. mcp.register_cron("name", { every = seconds, func = function() print("cron running") end }) Also accepts { rerun = false } to run the cron once after a reload. Can be used to check something after a reload has run, or simply issue a reload after an exact amount of time since the previous reload finished. Crons that are not seen after a config reload are unloaded. IE: the only crons that may run must have been registered during the last configuration reload. If a cron is overwriting itself, and the 'every' period has not changed, it will "inherit" the next scheduled run time. Thus config reloads will not interrupt the scheduling of crons that are not changing their time schedule. Also adds `mcp.config_reload()` which will schedule the system to reload its configuration after the cron finishes running.
- Loading branch information
Showing
6 changed files
with
339 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.