Merge pull request #346 from dokime7/master
Fix concurrency handling in order to avoid that some workers get the same task at the same time.
This commit is contained in:
+2
-2
@@ -912,10 +912,10 @@ class Scheduler(MetaScheduler):
|
|||||||
)
|
)
|
||||||
if not task.task_name:
|
if not task.task_name:
|
||||||
d['task_name'] = task.function_name
|
d['task_name'] = task.function_name
|
||||||
task.update_record(**d)
|
db((st.id==task.id) & (st.status.belongs((QUEUED, ASSIGNED)))).update(**d)
|
||||||
|
db.commit()
|
||||||
wkgroups[gname]['workers'][myw]['c'] += 1
|
wkgroups[gname]['workers'][myw]['c'] += 1
|
||||||
|
|
||||||
db.commit()
|
|
||||||
#I didn't report tasks but I'm working nonetheless!!!!
|
#I didn't report tasks but I'm working nonetheless!!!!
|
||||||
if x > 0:
|
if x > 0:
|
||||||
self.empty_runs = 0
|
self.empty_runs = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user