本文整理汇总了Python中celery.beat.Scheduler.reserve方法的典型用法代码示例。如果您正苦于以下问题:Python Scheduler.reserve方法的具体用法?Python Scheduler.reserve怎么用?Python Scheduler.reserve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类celery.beat.Scheduler
的用法示例。
在下文中一共展示了Scheduler.reserve方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reserve
# 需要导入模块: from celery.beat import Scheduler [as 别名]
# 或者: from celery.beat.Scheduler import reserve [as 别名]
def reserve(self, entry):
new_entry = Scheduler.reserve(self, entry)
# Need to story entry by name, because the entry may change
# in the mean time.
self._dirty.add(new_entry.name)
if self.should_flush():
self.logger.debug("Celerybeat: Writing schedule changes...")
self.flush()
return new_entry
示例2: reserve
# 需要导入模块: from celery.beat import Scheduler [as 别名]
# 或者: from celery.beat.Scheduler import reserve [as 别名]
def reserve(self, entry):
"""
This is called when a new instance of a task is scheduled to run. Hook
in here so we can avoid saving updates to tasks that have none.
"""
new_entry = Scheduler.reserve(self, entry)
# Add to a list of what has changed. Store by name since the entry
# itself may be a different instance by the time we get to it.
self._dirty.add(new_entry.name)
return new_entry
示例3: reserve
# 需要导入模块: from celery.beat import Scheduler [as 别名]
# 或者: from celery.beat.Scheduler import reserve [as 别名]
def reserve(self, entry):
new_entry = Scheduler.reserve(self, entry)
# Need to store entry by name, because the entry may change
# in the mean time.
self._dirty.add(new_entry.name)
return new_entry
示例4: reserve
# 需要导入模块: from celery.beat import Scheduler [as 别名]
# 或者: from celery.beat.Scheduler import reserve [as 别名]
def reserve(self, entry):
new_entry = Scheduler.reserve(self, entry)
return new_entry