Skip to content

Commit

Permalink
Remove socket file if it already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickTaibel committed Dec 29, 2022
1 parent 6bbbeb5 commit 127ff1c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ func createInstances(configs []PoolConfig) (rmuxInstances []*rmux.RedisMultiplex
if config.Socket != "" {
syscall.Umask(0111)
log.Info("Initializing rmux server on socket %s", config.Socket)
if err = os.RemoveAll(config.Socket); err != nil {
return
}
rmuxInstance, err = rmux.NewRedisMultiplexer("unix", config.Socket, config.PoolSize)
} else {
log.Info("Initializing rmux server on host: %s and port: %d", config.Host, config.Port)
Expand Down

0 comments on commit 127ff1c

Please sign in to comment.