本文整理汇总了Python中indico.modules.scheduler.Client.dequeue方法的典型用法代码示例。如果您正苦于以下问题:Python Client.dequeue方法的具体用法?Python Client.dequeue怎么用?Python Client.dequeue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类indico.modules.scheduler.Client
的用法示例。
在下文中一共展示了Client.dequeue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addOccurrenceNotificationsTask
# 需要导入模块: from indico.modules.scheduler import Client [as 别名]
# 或者: from indico.modules.scheduler.Client import dequeue [as 别名]
def addOccurrenceNotificationsTask(dbi, prevVersion):
"""
Add OccurrenceNotificationsTask to scheduler and remove old RoomReservationTask
"""
scheduler_client = Client()
scheduler_module = scheduler_client._schedMod
old_tasks = []
for _, task in scheduler_module.getWaitingQueue():
if getattr(task, 'typeId', None) in {'RoomReservationTask', 'RoomReservationEndTask'}:
old_tasks.append(task)
for task in scheduler_module._runningList:
if getattr(task, 'typeId', None) in {'RoomReservationTask', 'RoomReservationEndTask'}:
old_tasks.append(task)
for finished_task in scheduler_module._finishedIndex.values():
task = finished_task._task if hasattr(finished_task, '_task') else finished_task
if getattr(task, 'typeId', None) in {'RoomReservationTask', 'RoomReservationEndTask'}:
scheduler_module._finishedIndex.unindex_obj(finished_task)
for failed_task in scheduler_module._failedIndex.values():
task = failed_task._task if hasattr(failed_task, '_task') else failed_task
if getattr(task, 'typeId', None) in {'RoomReservationTask', 'RoomReservationEndTask'}:
scheduler_module._failedIndex.unindex_obj(failed_task)
for task in old_tasks:
scheduler_client.dequeue(task)
scheduler_client.enqueue(OccurrenceNotifications(rrule.HOURLY, byminute=0, bysecond=0))
dbi.commit()