feat: alert wecom when no designer is available

This commit is contained in:
2026-03-13 10:42:14 +08:00
parent 5a38fa9e6c
commit 5b36693c2e
4 changed files with 137 additions and 1 deletions

View File

@@ -160,3 +160,15 @@ def retry_pending_transfer(row_id: int, delay_seconds: int = 60, error: str = ""
(next_s, now_s, error[:500], row_id),
)
conn.commit()
def count_open_pending_transfers() -> int:
with _get_conn() as conn:
row = conn.execute(
"""
SELECT COUNT(*) AS cnt
FROM pending_transfers
WHERE status IN ('pending', 'processing')
"""
).fetchone()
return int(row["cnt"] or 0) if row else 0