feat: alert wecom when no designer is available
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user