Snapshot: full project state
This commit is contained in:
21
deploy/cleanup.py
Normal file
21
deploy/cleanup.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import os, glob
|
||||
import db
|
||||
db.init_db()
|
||||
db.set_setting('llm_timeout', '45')
|
||||
# remove test artifacts
|
||||
for p in glob.glob('/opt/procyon/test_*.py') + glob.glob('/opt/procyon/data/resumes/test_*.pdf'):
|
||||
try:
|
||||
os.remove(p)
|
||||
except Exception:
|
||||
pass
|
||||
# clean the synthetic test job/application from earlier verification
|
||||
conn = db.get_conn()
|
||||
try:
|
||||
conn.execute("DELETE FROM applications WHERE job_id IN (SELECT id FROM jobs WHERE url LIKE 'https://example.com%')")
|
||||
conn.execute("DELETE FROM jobs WHERE url LIKE 'https://example.com%'")
|
||||
conn.commit()
|
||||
finally:
|
||||
conn.close()
|
||||
print('llm_timeout =', db.get_setting('llm_timeout'))
|
||||
print('jobs remaining =', len(db.list_jobs(limit=1000)))
|
||||
print('CLEANUP_DONE')
|
||||
Reference in New Issue
Block a user