aboutsummaryrefslogtreecommitdiffstats
path: root/modules/graceful/manager.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-02-19 16:36:25 +0000
committerGitHub <noreply@github.com>2022-02-19 16:36:25 +0000
commit83c9035971e4b594686391a7ff052a7d1fe13771 (patch)
tree74877a0591159d1800c46b294d178b40f875f455 /modules/graceful/manager.go
parent4b3ebda0e78983682003e027a2da46d38f3ef76c (diff)
downloadgitea-83c9035971e4b594686391a7ff052a7d1fe13771.tar.gz
gitea-83c9035971e4b594686391a7ff052a7d1fe13771.zip
Immediately Hammer if second kill is sent (#18823)
Currently Gitea will wait for HammerTime or nice shutdown if kill -1 or kill -2 is sent. We should just immediately hammer if there is a second kill. Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/graceful/manager.go')
-rw-r--r--modules/graceful/manager.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/graceful/manager.go b/modules/graceful/manager.go
index 031c10d41b..f783573607 100644
--- a/modules/graceful/manager.go
+++ b/modules/graceful/manager.go
@@ -193,6 +193,7 @@ func (g *Manager) RunAtHammer(hammer func()) {
func (g *Manager) doShutdown() {
if !g.setStateTransition(stateRunning, stateShuttingDown) {
+ g.DoImmediateHammer()
return
}
g.lock.Lock()