forked from forgejo/forgejo
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:
parent
bb2c0c3729
commit
e3f22ad2cc
4 changed files with 31 additions and 30 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue