Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV(cache_critical_dns): add option to run once and exit
There are situations where a container running Discourse may want to cache the critical DNS services without running the cache_critical_dns service, for example running migrations prior to running a full bore application container. Add a `--once` argument for the cache_critical_dns script that will only execute the main loop once, and return the status code for the script to use when exiting. 0 indicates no errors occured during SRV resolution, and 1 indicates a failure during the SRV lookup. Nothing is reported to prometheus in run_once mode. Generally this mode of operation would be a part of a unix pipeline, in which the exit status is a more meaningful and immediate signal than a prometheus metric. The reporting has been moved into it's own method that can be called only when the script is running as a service. See /t/69597.
- Loading branch information