From 8eb2c3725199b17ae713dd0756a0e491e4829c12 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 30 Sep 2019 09:16:01 -0600 Subject: Clean up provisioned modules on error; refactor Run(); add Validate() Modules that return an error during provisioning should still be cleaned up so that they don't leak any resources they may have allocated before the error occurred. Cleanup should be able to run even if Provision does not complete fully. --- sigtrap.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sigtrap.go') diff --git a/sigtrap.go b/sigtrap.go index 8fae706..76bb666 100644 --- a/sigtrap.go +++ b/sigtrap.go @@ -65,9 +65,9 @@ func gracefulStop(sigName string) { os.Exit(exitCode) } -// Exit codes. Generally, you will want to avoid -// automatically restarting the process if the -// exit code is 1. +// Exit codes. Generally, you should NOT +// automatically restart the process if the +// exit code is ExitCodeFailedStartup (1). const ( ExitCodeSuccess = iota ExitCodeFailedStartup -- cgit v1.2.3