Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit ef909825 authored by Mikaël Salson's avatar Mikaël Salson Committed by Vidjil

task.py: Get updated database version

This commit fixes the issue of having STOPPED jobs stuck in that state.
I have assumptions on why the commit fixes the issue but no certainty.

When entering the `schedule_run` controller, web2py loads the database
in its current state. If someone then clicks on  to run the sample
that is currently being preprocessed, the task will be put in STOPPED
state to wait for the preprocess to finish.
Once the preprocess is finished, we query the DB to know which
tasks have been stopped. But as the DB has been loaded at the start
of the controller, it is not up-to-date anymore and doesn't
get all the STOPPED jobs. Doing a db.commit() just before
querying the STOPPED jobs could refresh the loaded DB.

Fix #2053.
parent 2ce78867
......@@ -725,7 +725,7 @@ def run_pre_process(pre_process_id, sequence_file_id, clean_before=True, clean_a
db.sequence_file[sequence_file_id] = dict(data_file = stream,
data_file2 = None,
pre_process_flag = "DONE")
db.commit()
#resume STOPPED task for this sequence file
stopped_task = db(
(db.results_file.sequence_file_id == sequence_file_id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment