Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, when healthchecks were stopped after a deploy complete, it was possible for one or more additional healthcheck results to be reported. This can happen for two reasons: - If the check is slower than the interval, it was possible that another check would be scheduled even when the shutdown channel is closed. This was due to the `select` choosing a path at random, in the case that the shutdown condition and the timer condition were both ready. - If the shutdown happens while a check is in progress, the check would still eventually complete and report its result, even though we no longer want it. To avoid this we do two things: - Before starting a check, additionally ensure the shutdown channel is not also closed. If it is, exit the loop instead. - When a check completes, only report the result if we're not shut down.
- Loading branch information