diff options
author | Wolfy-J <[email protected]> | 2018-06-10 13:36:59 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-10 13:36:59 +0300 |
commit | 549e357aca6e5bbfa0ff9a793f625f138445de2b (patch) | |
tree | 4734f0523d70640cfc7a85e83f7760f42d6e3f0e /rpc | |
parent | 16a347283b52f5cf997f9994cba79bba86a428c3 (diff) |
merge candidates and configured
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/service.go | 4 | ||||
-rw-r--r-- | rpc/service_test.go | 12 |
2 files changed, 0 insertions, 16 deletions
diff --git a/rpc/service.go b/rpc/service.go index 268087bc..516f341a 100644 --- a/rpc/service.go +++ b/rpc/service.go @@ -23,10 +23,6 @@ type Service struct { // Configure must return configure service and return true if service is enabled. Must return error in case of // misconfiguration. func (s *Service) Configure(cfg service.Config, reg service.Container) (enabled bool, err error) { - if s.cfg != nil { - return true, errors.New("service is already configured") - } - config := &config{} if err := cfg.Unmarshal(config); err != nil { return false, err diff --git a/rpc/service_test.go b/rpc/service_test.go index 13dd4930..a57ce1bd 100644 --- a/rpc/service_test.go +++ b/rpc/service_test.go @@ -50,18 +50,6 @@ func Test_Enabled(t *testing.T) { assert.True(t, ok) } -func Test_TwoConfigurations(t *testing.T) { - s := &Service{} - ok, err := s.Configure(&testCfg{`{"enable":true, "listen":"tcp://localhost:9008"}`}, nil) - - assert.NoError(t, err) - assert.True(t, ok) - - ok, err = s.Configure(&testCfg{`{"enable":true, "listen":"tcp://localhost:9008"}`}, nil) - assert.Error(t, err) - assert.True(t, ok) -} - func Test_StopNonServing(t *testing.T) { s := &Service{} ok, err := s.Configure(&testCfg{`{"enable":true, "listen":"tcp://localhost:9008"}`}, nil) |