debug
This commit is contained in:
@@ -512,8 +512,27 @@ def create_detect_job_if_needed(limit: int = 1000, created_by: str = "system") -
|
||||
domain_ids = [row[0] for row in cur.fetchall()]
|
||||
if not domain_ids:
|
||||
conn.rollback()
|
||||
return None
|
||||
|
||||
if not domain_ids:
|
||||
try:
|
||||
from app.services.sync_push_service import pull_detect_task_batch_now
|
||||
|
||||
pull_detect_task_batch_now(limit=max(1, int(limit or 1000)))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
with get_db() as conn:
|
||||
conn.autocommit = False
|
||||
with conn.cursor() as cur:
|
||||
cur.execute(_selection_sql(), (max(1, int(limit or 1000)),))
|
||||
domain_ids = [row[0] for row in cur.fetchall()]
|
||||
if not domain_ids:
|
||||
conn.rollback()
|
||||
return None
|
||||
|
||||
with get_db() as conn:
|
||||
conn.autocommit = False
|
||||
with conn.cursor() as cur:
|
||||
job_code = f"detect-{datetime.now().strftime('%Y%m%d%H%M%S')}-{uuid4().hex[:6]}"
|
||||
plan_hash = uuid4().hex
|
||||
cur.execute(
|
||||
|
||||
Reference in New Issue
Block a user