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:
20
manager.go
20
manager.go
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user