From cd436e9dc22c6eac51549c39916499d5888b1179 Mon Sep 17 00:00:00 2001 From: Peter Lyoo <102126644+peterlyoo@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:48:26 +0900 Subject: [PATCH] fix preferred window logic --- src/sbosc/component.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sbosc/component.py b/src/sbosc/component.py index 84090ea..e27e5f6 100644 --- a/src/sbosc/component.py +++ b/src/sbosc/component.py @@ -41,6 +41,8 @@ def is_preferred_window(): start_time_str, end_time_str = config.PREFERRED_WINDOW.split('-') start_time = datetime.strptime(start_time_str, '%H:%M').time() end_time = datetime.strptime(end_time_str, '%H:%M').time() + if start_time >= end_time: + return start_time <= current_time or current_time <= end_time return start_time <= current_time <= end_time def get_migration_id(self):