mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 18:04:14 +01:00
Remove unused error in graceful manager (#29871)
As title. (cherry picked from commit 1f0d31ce8fdfc8c32f84e4e0801c2d04b727bbd8)
This commit is contained in:
parent
4711d3311b
commit
40c9fa43cd
2 changed files with 4 additions and 12 deletions
|
@ -59,8 +59,8 @@ func (g *Manager) start() {
|
||||||
go func() {
|
go func() {
|
||||||
defer func() {
|
defer func() {
|
||||||
close(startupDone)
|
close(startupDone)
|
||||||
// Close the unused listeners and ignore the error here there's not much we can do with it, they're logged in the CloseProvidedListeners function
|
// Close the unused listeners
|
||||||
_ = CloseProvidedListeners()
|
closeProvidedListeners()
|
||||||
}()
|
}()
|
||||||
// Wait for all servers to be created
|
// Wait for all servers to be created
|
||||||
g.createServerCond.L.Lock()
|
g.createServerCond.L.Lock()
|
||||||
|
|
|
@ -129,25 +129,17 @@ func getProvidedFDs() (savedErr error) {
|
||||||
return savedErr
|
return savedErr
|
||||||
}
|
}
|
||||||
|
|
||||||
// CloseProvidedListeners closes all unused provided listeners.
|
// closeProvidedListeners closes all unused provided listeners.
|
||||||
func CloseProvidedListeners() error {
|
func closeProvidedListeners() {
|
||||||
mutex.Lock()
|
mutex.Lock()
|
||||||
defer mutex.Unlock()
|
defer mutex.Unlock()
|
||||||
var returnableError error
|
|
||||||
for _, l := range providedListeners {
|
for _, l := range providedListeners {
|
||||||
err := l.Close()
|
err := l.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Error in closing unused provided listener: %v", err)
|
log.Error("Error in closing unused provided listener: %v", err)
|
||||||
if returnableError != nil {
|
|
||||||
returnableError = fmt.Errorf("%v & %w", returnableError, err)
|
|
||||||
} else {
|
|
||||||
returnableError = err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
providedListeners = []net.Listener{}
|
providedListeners = []net.Listener{}
|
||||||
|
|
||||||
return returnableError
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultGetListener obtains a listener for the stream-oriented local network address:
|
// DefaultGetListener obtains a listener for the stream-oriented local network address:
|
||||||
|
|
Loading…
Reference in a new issue