mirror of
https://github.com/go-gitea/gitea
synced 2025-07-19 08:48:37 +00:00
Graceful: Allow graceful restart for unix sockets (#9113)
Previously we could not handle graceful restarts for http over unix sockets. These can now be handled.
This commit is contained in:
@@ -9,6 +9,7 @@ package graceful
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
@@ -48,6 +49,10 @@ func RestartProcess() (int, error) {
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
if unixListener, ok := l.(*net.UnixListener); ok {
|
||||
unixListener.SetUnlinkOnClose(false)
|
||||
}
|
||||
// Remember to close these at the end.
|
||||
defer files[i].Close()
|
||||
}
|
||||
|
Reference in New Issue
Block a user