Skip to content

Commit b463631

Browse files
jsixfaceTheDevMinerTV
authored andcommitted
Don't delete INI jobs
If a job is configured in the INI file but not mentioned in the docker labels, do not deregister the job.
1 parent 95be06b commit b463631

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

cli/config.go

-15
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,9 @@ func (c *Config) dockerLabelsUpdate(labels map[string]map[string]string) {
140140

141141
// Calculate the delta execJobs
142142
for name, j := range c.ExecJobs {
143-
found := false
144143
for newJobsName, newJob := range parsedLabelConfig.ExecJobs {
145144
// Check if the schedule has changed
146145
if name == newJobsName {
147-
found = true
148146
// There is a slight race condition were a job can be canceled / restarted with different params
149147
// so, lets take care of it by simply restarting
150148
// For the hash to work properly, we must fill the fields before calling it
@@ -163,11 +161,6 @@ func (c *Config) dockerLabelsUpdate(labels map[string]map[string]string) {
163161
break
164162
}
165163
}
166-
if !found {
167-
// Remove the job
168-
c.sh.RemoveJob(j)
169-
delete(c.ExecJobs, name)
170-
}
171164
}
172165

173166
// Check for aditions
@@ -190,11 +183,9 @@ func (c *Config) dockerLabelsUpdate(labels map[string]map[string]string) {
190183
}
191184

192185
for name, j := range c.RunJobs {
193-
found := false
194186
for newJobsName, newJob := range parsedLabelConfig.RunJobs {
195187
// Check if the schedule has changed
196188
if name == newJobsName {
197-
found = true
198189
// There is a slight race condition were a job can be canceled / restarted with different params
199190
// so, lets take care of it by simply restarting
200191
// For the hash to work properly, we must fill the fields before calling it
@@ -213,11 +204,6 @@ func (c *Config) dockerLabelsUpdate(labels map[string]map[string]string) {
213204
break
214205
}
215206
}
216-
if !found {
217-
// Remove the job
218-
c.sh.RemoveJob(j)
219-
delete(c.RunJobs, name)
220-
}
221207
}
222208

223209
// Check for aditions
@@ -238,7 +224,6 @@ func (c *Config) dockerLabelsUpdate(labels map[string]map[string]string) {
238224
c.RunJobs[newJobsName] = newJob
239225
}
240226
}
241-
242227
}
243228

244229
// ExecJobConfig contains all configuration params needed to build a ExecJob

0 commit comments

Comments
 (0)