diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-04-07 20:17:41 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-04-07 20:17:41 -0400 |
commit | 26eee62be8820373a61654c51c6f3622fe46d166 (patch) | |
tree | de8eceb3efb8383b681a3a3ce2803a78cfeb5b46 /captain/db.f90 | |
parent | 90591a3e98463bec9bb678a5058b8d714c765054 (diff) | |
download | levitating-26eee62be8820373a61654c51c6f3622fe46d166.tar.gz levitating-26eee62be8820373a61654c51c6f3622fe46d166.zip |
Fixed tasks such that they are created in the db initially. Fixed link to results to be consistent with filenames for saving results.
Diffstat (limited to 'captain/db.f90')
-rw-r--r-- | captain/db.f90 | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/captain/db.f90 b/captain/db.f90 index 7937383..7bc501d 100644 --- a/captain/db.f90 +++ b/captain/db.f90 @@ -608,13 +608,32 @@ contains end subroutine update_job_time + subroutine insert_task(job_id, task_id) + implicit none + + integer, intent(in)::job_id, task_id + type(sqlite3_stmt)::stmt + + if(stmt%prepare(db, "INSERT INTO tasks(job, task, status) VALUES(?,?,?") == SQLITE_OK) then + if(stmt%bind_int(1, job_id) == SQLITE_OK .and. & + stmt%bind_int(2, task_id) == SQLITE_OK .and. & + stmt%bind_int(3, JOB_STATUS_WORKING) == SQLITE_OK) then + call stmt%step_now() + end if + end if + call stmt%finalize() + + call update_job_time(job_id) + + end subroutine insert_task + subroutine update_task_status(job_id, task_id, status) implicit none integer, intent(in)::job_id, task_id, status type(sqlite3_stmt)::stmt - if(stmt%prepare(db, "UPDATE jobs SET status=? WHERE job=? AND task=?") == SQLITE_OK) then + if(stmt%prepare(db, "UPDATE tasks SET status=? WHERE job=? AND task=?") == SQLITE_OK) then if(stmt%bind_int(1, status) == SQLITE_OK .and. & stmt%bind_int(2, job_id) == SQLITE_OK .and. & stmt%bind_int(3, task_id) == SQLITE_OK) then |