mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 11:28:18 +00:00
1867202a4d
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.