diff --git a/app/brushtask.py b/app/brushtask.py index ea7bf83a..e58b21c0 100644 --- a/app/brushtask.py +++ b/app/brushtask.py @@ -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,不执行任务 \ No newline at end of file