1
0
mirror of https://gitea.com/gitea/graceful synced 2025-10-05 16:32:49 +02:00

make NumberOfServersToCreate changable (#2)

make NumberOfServersToCreate changable

Reviewed-on: https://gitea.com/gitea/graceful/pulls/2
This commit is contained in:
Lunny Xiao
2020-04-30 03:16:32 +00:00
parent af659568fd
commit 02a51019eb
2 changed files with 11 additions and 11 deletions

View File

@@ -16,6 +16,16 @@ var (
GracefulHammerTime = 60 * time.Second
StartupTimeout time.Duration
GracefulRestartable = true
// There are three places that could inherit sockets:
//
// * HTTP or HTTPS main listener
// * HTTP redirection fallback
// * SSH
//
// If you add an additional place you must increment this number
// and add a function to call manager.InformCleanup if it's not going to be used
NumberOfServersToCreate = 3
)
type state uint8
@@ -27,16 +37,6 @@ const (
stateTerminate
)
// There are three places that could inherit sockets:
//
// * HTTP or HTTPS main listener
// * HTTP redirection fallback
// * SSH
//
// If you add an additional place you must increment this number
// and add a function to call manager.InformCleanup if it's not going to be used
const numberOfServersToCreate = 3
// Manager represents the graceful server manager interface
var manager *Manager

View File

@@ -38,7 +38,7 @@ func newGracefulManager(ctx context.Context) *Manager {
isChild: len(os.Getenv(listenFDs)) > 0 && os.Getppid() > 1,
lock: &sync.RWMutex{},
}
manager.createServerWaitGroup.Add(numberOfServersToCreate)
manager.createServerWaitGroup.Add(NumberOfServersToCreate)
manager.start(ctx)
return manager
}