Skip to content

Commit

Permalink
feat: 刷流时间间隔支持跨天
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuan0213 committed Nov 13, 2024
1 parent d6b3417 commit ad151f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/brushtask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,10 @@ def is_in_time_range(time_range=None):

# 获取当前时间
now = datetime.now().time()
return start_time <= now <= end_time
if start_time < end_time:
return start_time <= now <= end_time
else:
return now >= start_time or now <= end_time
except ValueError:
log.warn("【Brush】时间段格式错误,应为 'HH:MM-HH:MM'")
return False # 格式错误时返回 False,不执行任务

0 comments on commit ad151f8

Please sign in to comment.