diff options
author | zeripath <art27@cantab.net> | 2019-11-21 18:32:02 +0000 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-11-21 13:32:02 -0500 |
commit | cbaa1de9ec8ab1baa49357b660fab16a68097c84 (patch) | |
tree | 5f481d73c95ae24b91e7bb03abaa5cf921f806b5 /modules/setting | |
parent | d7ac9727bb5046118915cbb26b2dac1b7b27c9d4 (diff) | |
download | gitea-cbaa1de9ec8ab1baa49357b660fab16a68097c84.tar.gz gitea-cbaa1de9ec8ab1baa49357b660fab16a68097c84.zip |
Add Graceful shutdown for Windows and hooks for shutdown of goroutines (#8964)
* Graceful Shutdown for windows and others
Restructures modules/graceful, adding shutdown for windows, removing and
replacing the old minwinsvc code.
Creates a new waitGroup - terminate which allows for goroutines to
finish up after the shutdown of the servers.
Shutdown and terminate hooks are added for goroutines.
* Remove unused functions - these can be added in a different PR
* Add startup timeout functionality
* Document STARTUP_TIMEOUT
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 6a45797cf2..dbe64fa3fd 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -24,7 +24,6 @@ import ( "code.gitea.io/gitea/modules/generate" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" - _ "code.gitea.io/gitea/modules/minwinsvc" // import minwinsvc for windows services "code.gitea.io/gitea/modules/user" shellquote "github.com/kballard/go-shellquote" @@ -99,6 +98,7 @@ var ( LetsEncryptEmail string GracefulRestartable bool GracefulHammerTime time.Duration + StartupTimeout time.Duration StaticURLPrefix string SSH = struct { @@ -569,6 +569,7 @@ func NewContext() { HTTPPort = sec.Key("HTTP_PORT").MustString("3000") GracefulRestartable = sec.Key("ALLOW_GRACEFUL_RESTARTS").MustBool(true) GracefulHammerTime = sec.Key("GRACEFUL_HAMMER_TIME").MustDuration(60 * time.Second) + StartupTimeout = sec.Key("STARTUP_TIMEOUT").MustDuration(0 * time.Second) defaultAppURL := string(Protocol) + "://" + Domain if (Protocol == HTTP && HTTPPort != "80") || (Protocol == HTTPS && HTTPPort != "443") { |