Skip to content
Snippets Groups Projects
Unverified Commit d237956f authored by Wolfgang Welz's avatar Wolfgang Welz Committed by GitHub
Browse files

Feat: Sort background workers during shutdown (#506)

parent ad9a2e53
Branches
Tags
No related merge requests found
......@@ -3,6 +3,7 @@ package gracefulshutdown
import (
"os"
"os/signal"
"sort"
"strings"
"syscall"
"time"
......@@ -44,6 +45,7 @@ var Plugin = node.NewPlugin(PluginName, node.Enabled, func(plugin *node.Plugin)
processList := ""
runningBackgroundWorkers := daemon.GetRunningBackgroundWorkers()
if len(runningBackgroundWorkers) >= 1 {
sort.Strings(runningBackgroundWorkers)
processList = "(" + strings.Join(runningBackgroundWorkers, ", ") + ") "
}
log.Warnf("Received shutdown request - waiting (max %d seconds) to finish processing %s...", WaitToKillTimeInSeconds-int(secondsSinceStart), processList)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment