Skip to content

Commit 7b647a5

Browse files
author
David Grieser
committed
More reverts.
1 parent 53a5ab2 commit 7b647a5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pkg/proc/basejob.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (job *baseJob) startOnce(ctx context.Context, process chan<- *os.Process) e
166166
return fmt.Errorf("failed to start job %s: %s", job.Config.Name, err.Error())
167167
}
168168

169-
// Only set job.Cmd if cmd.Start() was successful
169+
// Only set job.cmd if cmd.Start() was successful
170170
job.cmd = cmd
171171

172172
if process != nil {
@@ -226,7 +226,7 @@ func (job *baseJob) startOnce(ctx context.Context, process chan<- *os.Process) e
226226
return err
227227
}
228228
}
229-
// If job.Cmd or job.Cmd.Process is nil, it means the process didn't start or already cleaned up.
229+
// If job.cmd or job.cmd.Process is nil, it means the process didn't start or already cleaned up.
230230
l.WithField("job.name", job.Config.Name).Info("context done, but process was not running or already cleaned up.")
231231
return ctx.Err() // Return context error
232232
}

pkg/proc/job_common.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func (job *CommonJob) IsRunning() bool {
186186

187187
func (job *CommonJob) Restart() {
188188
job.restart = true
189-
// Ensure Cmd and Process are not nil before trying to signal
189+
// Ensure job.cmd and job.cmd.Process are not nil before trying to signal
190190
if job.cmd != nil && job.cmd.Process != nil {
191191
job.SignalAll(syscall.SIGTERM)
192192
}
@@ -197,7 +197,7 @@ func (job *CommonJob) Restart() {
197197

198198
func (job *CommonJob) Stop() {
199199
job.stop = true
200-
// Ensure Cmd and Process are not nil before trying to signal
200+
// Ensure job.cmd and job.cmd.Process are not nil before trying to signal
201201
if job.cmd != nil && job.cmd.Process != nil {
202202
job.SignalAll(syscall.SIGTERM)
203203
}
@@ -209,7 +209,7 @@ func (job *CommonJob) Stop() {
209209
func (job *CommonJob) Status() *CommonJobStatus {
210210
running := job.IsRunning()
211211
var pid int
212-
// Ensure Cmd and Process are not nil before trying to access Pid
212+
// Ensure job.cmd and job.cmd.Process are not nil before trying to access Pid
213213
if running && job.cmd != nil && job.cmd.Process != nil {
214214
pid = job.cmd.Process.Pid
215215
}

pkg/proc/job_lazy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ func (job *LazyJob) startProcessReaper(ctx context.Context) {
125125
continue
126126
}
127127

128-
// Ensure Cmd and Cmd.Process are not nil before accessing PID
128+
// Ensure job.cmd and job.cmd.Process are not nil before accessing PID
129129
if job.cmd == nil || job.cmd.Process == nil {
130-
l.Warn("job.process is not nil, but job.Cmd or job.Cmd.Process is nil; skipping reap cycle")
130+
l.Warn("job.process is not nil, but job.cmd or job.cmd.Process is nil; skipping reap cycle")
131131
job.lazyStartLock.Unlock()
132132
continue
133133
}

0 commit comments

Comments
 (0)