Skip to content
Snippets Groups Projects
Commit 5c208f82 authored by Cyril Danilevski's avatar Cyril Danilevski :scooter: Committed by Karim Ahmed
Browse files

webservice: correctly parse all submitted slurm jobs

parent f3ee65fc
No related branches found
No related tags found
1 merge request!584Fix issues found in testing
...@@ -513,13 +513,22 @@ async def run_action(job_db, cmd, mode, proposal, run, rid) -> str: ...@@ -513,13 +513,22 @@ async def run_action(job_db, cmd, mode, proposal, run, rid) -> str:
rstr = stdout.decode() rstr = stdout.decode()
for r in rstr.split("\n"): for r in rstr.split("\n"):
if "Submitted job:" in r: if "Submitted the following SLURM jobs:" in r:
_, jobid = r.split(":") _, jobids = r.split(":")
c.execute(
"INSERT INTO jobs VALUES (?, ?, ?, ?, 'PD', ?, ?, ?)", jobs = []
(rid, jobid.strip(), proposal, run, for jobid in jobids.split(','):
datetime.now().isoformat(), cmd[3], cmd[4]) jobs.append((rid,
) jobid.strip(),
proposal,
run,
datetime.now().isoformat(),
cmd[3],
cmd[4])
)
c.executemany(
"INSERT INTO jobs VALUES (?, ?, ?, ?, 'PD', ?, ?, ?)",
jobs)
job_db.commit() job_db.commit()
else: # mode == "sim" else: # mode == "sim"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment