本文整理汇总了Python中scheduler.Scheduler.clear_locks方法的典型用法代码示例。如果您正苦于以下问题:Python Scheduler.clear_locks方法的具体用法?Python Scheduler.clear_locks怎么用?Python Scheduler.clear_locks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scheduler.Scheduler
的用法示例。
在下文中一共展示了Scheduler.clear_locks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: bootstrap_scheduler
# 需要导入模块: from scheduler import Scheduler [as 别名]
# 或者: from scheduler.Scheduler import clear_locks [as 别名]
def bootstrap_scheduler(self):
print "Bootstrapping scheduler..."
bootstrapped = False
try:
self.save("plugin_modules_library", self._plugin_modules_library)
Scheduler.clear_locks(self)
self.scheduler = Scheduler()
for plugin_info, fn, function_name in self.periodic_tasks:
self.add_periodic_task(
plugin_info["full_module_name"],
plugin_info["name"],
function_name,
fn.sched_args,
fn.sched_kwargs,
fn.function_name,
)
for plugin_info, fn, function_name in self.random_tasks:
self.add_random_tasks(
plugin_info["full_module_name"],
plugin_info["name"],
function_name,
fn.start_hour,
fn.end_hour,
fn.day_of_week,
fn.num_times_per_day,
)
bootstrapped = True
except Exception, e:
self.startup_error("Error bootstrapping scheduler", e)
示例2: bootstrap_scheduler
# 需要导入模块: from scheduler import Scheduler [as 别名]
# 或者: from scheduler.Scheduler import clear_locks [as 别名]
def bootstrap_scheduler(self):
bootstrapped = False
try:
self.save("plugin_modules_library", self._plugin_modules_library)
Scheduler.clear_locks(self)
self.scheduler = Scheduler()
for plugin_info, fn, function_name in self.periodic_tasks:
meta = fn.will_fn_metadata
self.add_periodic_task(
plugin_info["full_module_name"],
plugin_info["name"],
function_name,
meta["sched_args"],
meta["sched_kwargs"],
meta["function_name"],
)
for plugin_info, fn, function_name in self.random_tasks:
meta = fn.will_fn_metadata
self.add_random_tasks(
plugin_info["full_module_name"],
plugin_info["name"],
function_name,
meta["start_hour"],
meta["end_hour"],
meta["day_of_week"],
meta["num_times_per_day"]
)
bootstrapped = True
except Exception, e:
self.startup_error("Error bootstrapping scheduler", e)