File size: 417 Bytes
324a56b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import sqlite3
import app
print(f"DB PATH is: {app.DB_PATH}")
conn = sqlite3.connect(app.DB_PATH)
conn.row_factory = sqlite3.Row
c = conn.cursor()
c.execute("SELECT id, url, status, mode, error FROM jobs WHERE status='failed' ORDER BY id DESC LIMIT 5")
rows = c.fetchall()
for r in rows:
print(f"--- JOB {r['id']} ({r['mode']}) ---")
print(f"URL: {r['url']}")
print(f"ERROR: {r['error']}")
print("")
|