|
|
@@ -74,13 +74,20 @@ class StandaloneGCO:
|
|
|
return 30.0
|
|
|
|
|
|
def _is_within_active_hours(self) -> bool:
|
|
|
- """Determine if current time is within active operating window for instances and queries."""
|
|
|
+ """Determine if current time is within active operating window for instances and queries (UTC)."""
|
|
|
start_str = self.m_cfg.active_time_start
|
|
|
end_str = self.m_cfg.active_time_end
|
|
|
- current_bj_time = datetime.utcnow().time()
|
|
|
+ if (start_str == "00:00" and end_str == "23:59") or not start_str or not end_str:
|
|
|
+ return True
|
|
|
+
|
|
|
+ current_utc_time = datetime.now(timezone.utc).time()
|
|
|
start_time = datetime.strptime(start_str, "%H:%M").time()
|
|
|
end_time = datetime.strptime(end_str, "%H:%M").time()
|
|
|
- return start_time <= current_bj_time <= end_time
|
|
|
+
|
|
|
+ if start_time <= end_time:
|
|
|
+ return start_time <= current_utc_time <= end_time
|
|
|
+ else:
|
|
|
+ return current_utc_time >= start_time or current_utc_time <= end_time
|
|
|
|
|
|
def update_config(self, new_cfg: BookerStandaloneConfig):
|
|
|
"""Dynamically update group configuration."""
|