scheduler.py 文件源码

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

项目:coopcontrol 作者: isometimescode 项目源码 文件源码
def check_item(item):
    current_time = datetime.now(tz.tzlocal())

    start = item.get_start_time()
    end = item.get_end_time()

    if start <= current_time < end:
        logging.debug('within the start and end time, %s should be %s',
                      item.__class__.__name__,
                      item.get_status_name(1))
        item.set_status(1)
    else:
        logging.debug('outside the start and end time, %s should be %s',
                      item.__class__.__name__,
                      item.get_status_name(0))
        item.set_status(0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号