@@ -140,11 +140,9 @@ func (c *Config) dockerLabelsUpdate(labels map[string]map[string]string) {
140
140
141
141
// Calculate the delta execJobs
142
142
for name , j := range c .ExecJobs {
143
- found := false
144
143
for newJobsName , newJob := range parsedLabelConfig .ExecJobs {
145
144
// Check if the schedule has changed
146
145
if name == newJobsName {
147
- found = true
148
146
// There is a slight race condition were a job can be canceled / restarted with different params
149
147
// so, lets take care of it by simply restarting
150
148
// 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) {
163
161
break
164
162
}
165
163
}
166
- if ! found {
167
- // Remove the job
168
- c .sh .RemoveJob (j )
169
- delete (c .ExecJobs , name )
170
- }
171
164
}
172
165
173
166
// Check for aditions
@@ -190,11 +183,9 @@ func (c *Config) dockerLabelsUpdate(labels map[string]map[string]string) {
190
183
}
191
184
192
185
for name , j := range c .RunJobs {
193
- found := false
194
186
for newJobsName , newJob := range parsedLabelConfig .RunJobs {
195
187
// Check if the schedule has changed
196
188
if name == newJobsName {
197
- found = true
198
189
// There is a slight race condition were a job can be canceled / restarted with different params
199
190
// so, lets take care of it by simply restarting
200
191
// 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) {
213
204
break
214
205
}
215
206
}
216
- if ! found {
217
- // Remove the job
218
- c .sh .RemoveJob (j )
219
- delete (c .RunJobs , name )
220
- }
221
207
}
222
208
223
209
// Check for aditions
@@ -238,7 +224,6 @@ func (c *Config) dockerLabelsUpdate(labels map[string]map[string]string) {
238
224
c .RunJobs [newJobsName ] = newJob
239
225
}
240
226
}
241
-
242
227
}
243
228
244
229
// ExecJobConfig contains all configuration params needed to build a ExecJob
0 commit comments