summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNanguan Lin <nanguanlin6@gmail.com>2024-03-19 05:14:51 +0800
committerGitHub <noreply@github.com>2024-03-18 21:14:51 +0000
commit1f0d31ce8fdfc8c32f84e4e0801c2d04b727bbd8 (patch)
treea50b072720dee9538ee5495a82950abf8b3059d2
parent34290a00c4501ffeba26db267be71ab68e3ec97f (diff)
downloadgitea-1f0d31ce8fdfc8c32f84e4e0801c2d04b727bbd8.tar.gz
gitea-1f0d31ce8fdfc8c32f84e4e0801c2d04b727bbd8.zip
Remove unused error in graceful manager (#29871)
As title.
-rw-r--r--modules/graceful/manager_unix.go4
-rw-r--r--modules/graceful/net_unix.go12
2 files changed, 4 insertions, 12 deletions
diff --git a/modules/graceful/manager_unix.go b/modules/graceful/manager_unix.go
index f49c42650c..d03fff9b5b 100644
--- a/modules/graceful/manager_unix.go
+++ b/modules/graceful/manager_unix.go
@@ -59,8 +59,8 @@ func (g *Manager) start() {
go func() {
defer func() {
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
- _ = CloseProvidedListeners()
+ // Close the unused listeners
+ closeProvidedListeners()
}()
// Wait for all servers to be created
g.createServerCond.L.Lock()
diff --git a/modules/graceful/net_unix.go b/modules/graceful/net_unix.go
index 4f8c036a69..796e00507c 100644
--- a/modules/graceful/net_unix.go
+++ b/modules/graceful/net_unix.go
@@ -129,25 +129,17 @@ func getProvidedFDs() (savedErr error) {
return savedErr
}
-// CloseProvidedListeners closes all unused provided listeners.
-func CloseProvidedListeners() error {
+// closeProvidedListeners closes all unused provided listeners.
+func closeProvidedListeners() {
mutex.Lock()
defer mutex.Unlock()
- var returnableError error
for _, l := range providedListeners {
err := l.Close()
if err != nil {
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{}
-
- return returnableError
}
// DefaultGetListener obtains a listener for the stream-oriented local network address: