diff options
| author | chrislu <chris.lu@gmail.com> | 2022-05-04 14:55:14 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-05-04 14:55:14 -0700 |
| commit | ef6c6c450e1e062de1b0197ff0e1f83060c5f3b1 (patch) | |
| tree | 4be04b888cf95cca1edabe0f01c0a162a3c1bdd9 /weed/util/net_timeout.go | |
| parent | f7366a9668031880795385cb48ce1e12cc6c4329 (diff) | |
| download | seaweedfs-ef6c6c450e1e062de1b0197ff0e1f83060c5f3b1.tar.xz seaweedfs-ef6c6c450e1e062de1b0197ff0e1f83060c5f3b1.zip | |
avoid fatal error if port is already in use
Diffstat (limited to 'weed/util/net_timeout.go')
| -rw-r--r-- | weed/util/net_timeout.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/util/net_timeout.go b/weed/util/net_timeout.go index 21aab30f8..536359eec 100644 --- a/weed/util/net_timeout.go +++ b/weed/util/net_timeout.go @@ -1,6 +1,7 @@ package util import ( + "github.com/chrislusf/seaweedfs/weed/glog" "net" "time" @@ -112,7 +113,8 @@ func NewIpAndLocalListeners(host string, port int, timeout time.Duration) (ipLis if host != "localhost" && host != "" && host != "0.0.0.0" && host != "127.0.0.1" && host != "[::]" && host != "[::1]" { listner, err = net.Listen("tcp", JoinHostPort("localhost", port)) if err != nil { - return + glog.V(0).Infof("skip starting on %s:%d: %v", host, port, err) + return ipListner, nil, nil } localListener = &Listener{ |
