scheduler.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:borgcube 作者: enkore 项目源码 文件源码
def borgcubed_idle(apiserver):
    """Check schedule. Are we supposed to do something right about now?"""
#    seconds = seconds_until_next_occurence()
#    log.debug('setting alarm clock to beep in %d seconds', seconds)
#    signal.alarm(seconds)
    this_very_moment = now()
    for schedule in data_root().schedules:
        if not schedule.recurrence_enabled:
            continue
        # TODO: when django-recurrence#81 is resolved, use cache.
        occurence = schedule.recurrence.after(this_very_moment)
        if latest_executions.get(schedule._p_oid) == occurence:
            continue
        if occurence and abs((occurence - this_very_moment).total_seconds()) < 10:
            latest_executions[schedule._p_oid] = occurence
            execute(apiserver, schedule)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号