Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
ef4441ac
Commit
ef4441ac
authored
Aug 09, 2016
by
marc
Committed by
Mathieu Giraud
Sep 22, 2016
Browse files
task.py : suspend/resume vidjil_run waiting for pre-process
parent
8f8ca64b
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/web2py/applications/vidjil/models/task.py
View file @
ef4441ac
...
...
@@ -114,6 +114,10 @@ def schedule_run(id_sequence, id_config, grep_reads=None):
##add task to scheduler
task
=
scheduler
.
queue_task
(
program
,
args
,
repeats
=
1
,
timeout
=
defs
.
TASK_TIMEOUT
)
if
db
.
sequence_file
[
id_sequence
].
pre_process_flag
==
"WAIT"
or
db
.
sequence_file
[
id_sequence
].
pre_process_flag
==
"RUN"
:
db
.
scheduler_task
[
task
.
id
]
=
dict
(
status
=
"STOPPED"
)
db
.
results_file
[
data_id
]
=
dict
(
scheduler_task_id
=
task
.
id
)
filename
=
db
.
sequence_file
[
id_sequence
].
filename
...
...
@@ -710,6 +714,18 @@ 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"
)
#resume STOPPED task for this sequence file
stopped_task
=
db
(
(
db
.
results_file
.
sequence_file_id
==
sequence_file_id
)
&
(
db
.
results_file
.
scheduler_task_id
==
db
.
scheduler_task
.
id
)
&
(
db
.
scheduler_task
.
status
==
"STOPPED"
)
).
select
()
for
row
in
stopped_task
:
db
.
scheduler_task
[
row
.
scheduler_task
.
id
]
=
dict
(
status
=
"QUEUED"
)
db
.
commit
()
# Dump log in scheduler_run.run_output
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment