fix: remove previous socket file to prevent bind error (#979)

This commit is contained in:
Caian Benedicto
2025-09-24 10:10:05 +00:00
committed by GitHub
parent b746ac0835
commit 47bd5ba1ba

View File

@@ -119,6 +119,7 @@ func initRouterInternal(db *gorm.DB, svc *services) (utils.Service, error) {
if common.EnvConfig.UnixSocket != "" {
network = "unix"
addr = common.EnvConfig.UnixSocket
os.Remove(addr) // remove dangling the socket file to avoid file-exist error
}
listener, err := net.Listen(network, addr) //nolint:noctx