当前位置: 首页>>代码示例>>Python>>正文


Python Scheduler.clear_locks方法代码示例

本文整理汇总了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)
开发者ID:Bengt,项目名称:will,代码行数:33,代码来源:main.py

示例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)
开发者ID:AirbornePorcine,项目名称:will,代码行数:33,代码来源:main.py


注:本文中的scheduler.Scheduler.clear_locks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。