File tree Expand file tree Collapse file tree 3 files changed +1
-24
lines changed
utils/subprocess/supervisor Expand file tree Collapse file tree 3 files changed +1
-24
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -9,5 +9,4 @@ import "context"
9
9
type ISupervisor interface {
10
10
// 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
11
11
Run (ctx context.Context ) error
12
- Stop () error
13
12
}
Original file line number Diff line number Diff line change @@ -129,21 +129,7 @@ func (s *Supervisor) Run(ctx context.Context) (err error) {
129
129
return fmt .Errorf ("%w: command was undefined" , commonerrors .ErrUndefined )
130
130
}
131
131
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 )
147
133
148
134
if s .postStart != nil {
149
135
err = s .postStart (ctx )
@@ -183,10 +169,3 @@ func (s *Supervisor) Run(ctx context.Context) (err error) {
183
169
184
170
return
185
171
}
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