1
0
mirror of https://github.com/linkedin/oncall.git synced 2025-11-29 23:38:17 +02:00

Fix RR scheduler bug

WHERE clauses are important
This commit is contained in:
Daniel Wang
2018-07-18 17:48:12 -07:00
committed by Joe Gillotti
parent 170f7145fc
commit f1fe813c38

View File

@@ -73,10 +73,10 @@ class Scheduler(default.Scheduler):
%s, %s, %s, %s, %s, %s, %s
)'''
cursor.execute(query, event_args)
cursor.execute('UPDATE `schedule` SET `last_scheduled_user_id` = %s', user_id)
cursor.execute('UPDATE `schedule` SET `last_scheduled_user_id` = %s WHERE `id` = %s', (user_id, schedule_id))
def populate(self, schedule, start_time, dbinfo):
_, cursor = dbinfo
# Null last_scheduled_user to force find_next_user to determine that from the calendar
cursor.execute('UPDATE `schedule` SET `last_scheduled_user_id` = NULL')
cursor.execute('UPDATE `schedule` SET `last_scheduled_user_id` = NULL WHERE `id` = %s', schedule['id'])
super(Scheduler, self).populate(schedule, start_time, dbinfo)