File tree Expand file tree Collapse file tree
utils/subprocess/supervisor Expand file tree Collapse file tree Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -9,5 +9,4 @@ import "context"
99type ISupervisor interface {
1010 // Run will run the supervisor and execute any of the command hooks. If it receives a halting error or the context is cancelled then it will exit
1111 Run (ctx context.Context ) error
12- Stop () error
1312}
Original file line number Diff line number Diff line change @@ -129,21 +129,7 @@ func (s *Supervisor) Run(ctx context.Context) (err error) {
129129 return fmt .Errorf ("%w: command was undefined" , commonerrors .ErrUndefined )
130130 }
131131
132- g .Go (s .cmd .Start )
133- for ! s .cmd .IsOn () { // wait for job to start
134- if err := parallelisation .DetermineContextError (ctx ); err != nil {
135- break
136- }
137- parallelisation .SleepWithContext (ctx , 200 * time .Millisecond )
138- }
139- for s .cmd .IsOn () { // wait for job to end
140- if err := parallelisation .DetermineContextError (ctx ); err != nil {
141- break
142- }
143- parallelisation .SleepWithContext (ctx , 200 * time .Millisecond )
144- }
145-
146- fmt .Println (1234456 )
132+ g .Go (s .cmd .Execute )
147133
148134 if s .postStart != nil {
149135 err = s .postStart (ctx )
@@ -183,10 +169,3 @@ func (s *Supervisor) Run(ctx context.Context) (err error) {
183169
184170 return
185171}
186-
187- func (s * Supervisor ) Stop () error {
188- if s .cmd == nil {
189- return nil
190- }
191- return s .cmd .Interrupt ()
192- }
You can’t perform that action at this time.
0 commit comments