|
|
@@ -91,6 +91,11 @@ def _next_delivery_start(now: datetime, start_hour: int) -> datetime:
|
|
|
)
|
|
|
|
|
|
|
|
|
+def _delivery_end_allows_day(raw_end_date: Any, target_date: str) -> bool:
|
|
|
+ end_date = str(raw_end_date or "").strip()
|
|
|
+ return end_date in {"", "0"} or end_date >= target_date
|
|
|
+
|
|
|
+
|
|
|
def _load_today_metrics(
|
|
|
client: TencentClient,
|
|
|
account_id: int,
|
|
|
@@ -164,8 +169,9 @@ def preview_write_command(
|
|
|
)
|
|
|
and (
|
|
|
parsed.action == ACTION_STOP
|
|
|
- or not str(ad.get("end_date") or "")
|
|
|
- or str(ad.get("end_date")) >= next_day
|
|
|
+ or _delivery_end_allows_day(
|
|
|
+ ad.get("end_date"), next_day
|
|
|
+ )
|
|
|
)
|
|
|
and (
|
|
|
parsed.action == ACTION_STOP
|