Skip to content
Snippets Groups Projects

[Webservice] Restructure database to give more meaningful success/failure information

Merged Thomas Kluyver requested to merge webservice-refactor-db into master
1 file
+ 8
5
Compare changes
  • Side-by-side
  • Inline
+ 8
5
@@ -16,11 +16,14 @@ proposal = args['proposal'].zfill(6)
run = args['run']
conn = sqlite3.connect(sqlite_fpath)
c = conn.cursor()
c.execute("SELECT * FROM jobs")
c = conn.execute(
"SELECT status, elapsed, karabo_id, det_type, action FROM "
"slurm_jobs INNER JOIN executions USING (exec_id) "
"INNER JOIN requests USING (req_id) "
"WHERE proposal = ? AND run = ?",
(proposal, run)
)
for r in c.fetchall():
rid, jobid, db_proposal, db_run, status, time, _, _ = r
if db_proposal == proposal and db_run == run:
print(r)
print(r)
Loading