From 918e7de39e16eb293567427f2e8e8c3035690163 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Sat, 23 Jun 2018 17:55:52 +0300 Subject: one way destruction of the pool --- cmd/rr/cmd/version.go | 6 ++++-- server_config.go | 5 +++++ service/http/rpc_test.go | 6 +++--- service/http/service_test.go | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/cmd/rr/cmd/version.go b/cmd/rr/cmd/version.go index 5edb7543..45631fbb 100644 --- a/cmd/rr/cmd/version.go +++ b/cmd/rr/cmd/version.go @@ -1,6 +1,8 @@ package cmd var ( - Version = "1.0.0" // Placeholder for the version - BuildTime = "development" // Placeholder for the build time + // Version - defines build version. + Version = "1.0.0" + // BuildTime - defined build time. + BuildTime = "development" ) diff --git a/server_config.go b/server_config.go index ecd7dd2b..b927c8c6 100644 --- a/server_config.go +++ b/server_config.go @@ -5,6 +5,7 @@ import ( "net" "os/exec" "strings" + "syscall" "time" ) @@ -51,6 +52,10 @@ func (cfg *ServerConfig) makeFactory() (Factory, error) { return nil, errors.New("invalid relay DSN (pipes, tcp://:6001, unix://rr.sock)") } + if dsn[0] == "unix" { + syscall.Unlink(dsn[1]) + } + ln, err := net.Listen(dsn[0], dsn[1]) if err != nil { return nil, err diff --git a/service/http/rpc_test.go b/service/http/rpc_test.go index 4edb7058..c392b060 100644 --- a/service/http/rpc_test.go +++ b/service/http/rpc_test.go @@ -1,17 +1,17 @@ package http import ( + "encoding/json" "github.com/sirupsen/logrus" "github.com/sirupsen/logrus/hooks/test" "github.com/spiral/roadrunner/service" "github.com/spiral/roadrunner/service/rpc" "github.com/stretchr/testify/assert" + "os" + "runtime" "strconv" "testing" "time" - "runtime" - "os" - "encoding/json" ) func Test_RPC(t *testing.T) { diff --git a/service/http/service_test.go b/service/http/service_test.go index 10a20662..55fa660b 100644 --- a/service/http/service_test.go +++ b/service/http/service_test.go @@ -397,4 +397,4 @@ func tmpDir() string { r, _ := json.Marshal(p) return string(r) -} \ No newline at end of file +} -- cgit v1.2.3