leo: warn on NULL source_path in _terminate_pr (Ganymede nit)
If source_path is NULL, the source requeue silently matches nothing. Log a warning so we catch orphaned terminations in monitoring. Pentagon-Agent: Leo <294C3CA1-0205-4668-82FA-B984D54F48AD>
This commit is contained in:
parent
e7c902bac8
commit
f4dc6b39ce
1 changed files with 3 additions and 1 deletions
|
|
@ -151,12 +151,14 @@ async def _terminate_pr(conn, pr_number: int, reason: str):
|
|||
)
|
||||
|
||||
# Tag source for re-extraction with feedback
|
||||
conn.execute(
|
||||
cursor = conn.execute(
|
||||
"""UPDATE sources SET status = 'needs_reextraction',
|
||||
updated_at = datetime('now')
|
||||
WHERE path = (SELECT source_path FROM prs WHERE number = ?)""",
|
||||
(pr_number,),
|
||||
)
|
||||
if cursor.rowcount == 0:
|
||||
logger.warning("PR #%d: no source_path linked — source not requeued for re-extraction", pr_number)
|
||||
|
||||
db.audit(conn, "evaluate", "pr_terminated", json.dumps({
|
||||
"pr": pr_number, "reason": reason,
|
||||
|
|
|
|||
Loading…
Reference in a new issue