diff --git a/client/service.go b/client/service.go index 57c561c3..e9604957 100644 --- a/client/service.go +++ b/client/service.go @@ -225,16 +225,15 @@ func (srv *Service) subscribe(sub store.Subscription) error { return errors.New("already subscribed to this jobid") } - var startService services.Starter + var service services.Service + var err error + triggerJobRun := make(chan subscriber.Event, 100) js, err := srv.store.LoadJobSpec(sub.Job) if err != nil || gjson.GetBytes(js.Spec, "fluxmonitor").Raw == "null" { - startService = srv.subscribeRunlog + service, err = srv.subscribeRunlog(sub, triggerJobRun, js) } else { - startService = srv.subscribeFluxmonitor + service, err = srv.subscribeFluxmonitor(sub, triggerJobRun, js) } - - triggerJobRun := make(chan subscriber.Event, 100) - service, err := startService(sub, triggerJobRun, js) if err != nil { return err } diff --git a/services/service.go b/services/service.go index fefcdf39..2478dbd2 100644 --- a/services/service.go +++ b/services/service.go @@ -1,12 +1,5 @@ package services -import ( - "github.com/smartcontractkit/external-initiator/store" - "github.com/smartcontractkit/external-initiator/subscriber" -) - -type Starter func(sub store.Subscription, ch chan subscriber.Event, js *store.JobSpec) (Service, error) - type Service interface { Stop() }