Explorer
/tmp/aa043_p30_requeue_274.py
← Zurück ↓ Download
import sqlite3,datetime,json
DB='/opt/struktur/youtube-research/knowledge.db'; c=sqlite3.connect(DB,timeout=30); c.row_factory=sqlite3.Row; c.execute('PRAGMA busy_timeout=30000'); c.execute('BEGIN IMMEDIATE')
r=c.execute("SELECT job_id,video_id,youtube_id,status,step,attempts FROM e2e_jobs WHERE job_id=274").fetchone(); assert r and r['status']=='local_transcript_pending' and r['attempts']==0 and r['youtube_id']=='d2MiSnElwrw'
cur=c.execute("UPDATE e2e_jobs SET status='queued',step='queued',updated_at=?,error_code=NULL,error_message=NULL,local_retry_after=NULL WHERE job_id=274 AND status='local_transcript_pending' AND attempts=0",(datetime.datetime.now(datetime.timezone.utc).isoformat(),)); assert cur.rowcount==1
c.commit(); print(json.dumps(dict(c.execute('select job_id,video_id,youtube_id,status,step,attempts from e2e_jobs where job_id=274').fetchone()))); c.close()