1
0
Fork 0
forked from External/ergo

Merge pull request #1607 from slingamn/semaphore_update

simplify semaphore release code
This commit is contained in:
Shivaram Lingamneni 2021-04-07 08:56:53 -04:00 committed by GitHub
commit f0796b2eb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 51 deletions

View file

@ -612,11 +612,11 @@ func (server *Server) applyConfig(config *Config) (err error) {
if initial {
maxIPConc := int(config.Server.IPCheckScript.MaxConcurrency)
if maxIPConc != 0 {
server.semaphores.IPCheckScript.Initialize(maxIPConc)
server.semaphores.IPCheckScript = utils.NewSemaphore(maxIPConc)
}
maxAuthConc := int(config.Accounts.AuthScript.MaxConcurrency)
if maxAuthConc != 0 {
server.semaphores.AuthScript.Initialize(maxAuthConc)
server.semaphores.AuthScript = utils.NewSemaphore(maxAuthConc)
}
if err := overrideServicePrefixes(config.Server.OverrideServicesHostname); err != nil {