mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
fix socket remove
This commit is contained in:
parent
3744994ea8
commit
ec0ca59539
|
|
@ -20,9 +20,11 @@ import (
|
|||
"database/sql"
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"io"
|
||||
"io/fs"
|
||||
"net"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
|
|
@ -435,8 +437,8 @@ func (b *BaseDendrite) SetupAndServeHTTP(
|
|||
}
|
||||
} else {
|
||||
if externalHTTPAddr.IsUnixSocket() {
|
||||
err := os.RemoveAll(externalHTTPAddr.Address)
|
||||
if err != nil {
|
||||
err := os.Remove(externalHTTPAddr.Address)
|
||||
if err != nil && !errors.Is(err, fs.ErrNotExist) {
|
||||
logrus.WithError(err).Fatal("failed to remove existing unix socket")
|
||||
}
|
||||
listener, err := net.Listen(externalHTTPAddr.Network(), externalHTTPAddr.Address)
|
||||
|
|
|
|||
Loading…
Reference in a new issue