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)
评论列表
文章目录