Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
jflow
Commits
53d4e4b9
Commit
53d4e4b9
authored
Feb 25, 2016
by
Frédéric Escudié
Browse files
Add mail management when an error occur in preprocess.
parent
b37a6262
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/jflow/workflow.py
View file @
53d4e4b9
...
...
@@ -829,56 +829,36 @@ class Workflow(threading.Thread):
self
.
_serialize
()
# if pre_processing has not been done yet
if
self
.
__step
==
0
:
try
:
self
.
pre_process
()
self
.
__step
=
1
except
:
self
.
_status
=
self
.
STATUS_FAILED
self
.
end_time
=
time
.
time
()
raise
finally
:
self
.
_serialize
()
self
.
pre_process
()
self
.
__step
=
1
self
.
_serialize
()
# if collecting components and running workflow has not been done yet
if
self
.
__step
==
1
:
try
:
self
.
reseted_components
=
[]
self
.
components
=
[]
self
.
_status
=
self
.
STATUS_STARTED
self
.
_postprocess_status
=
self
.
STATUS_PENDING
self
.
_serialize
()
self
.
wf_execution_wrapper
()
self
.
component_nameids_is_init
=
True
if
self
.
dynamic_component_present
:
self
.
__step
=
2
else
:
self
.
_execute_weaver
()
self
.
__step
=
3
except
:
self
.
_status
=
self
.
STATUS_FAILED
self
.
end_time
=
time
.
time
()
self
.
_send_email
()
raise
finally
:
self
.
_serialize
()
self
.
reseted_components
=
[]
self
.
components
=
[]
self
.
_status
=
self
.
STATUS_STARTED
self
.
_postprocess_status
=
self
.
STATUS_PENDING
self
.
_serialize
()
self
.
wf_execution_wrapper
()
self
.
component_nameids_is_init
=
True
if
self
.
dynamic_component_present
:
self
.
__step
=
2
else
:
self
.
_execute_weaver
()
self
.
__step
=
3
self
.
_serialize
()
# if the workflow was a dynamic one
if
self
.
__step
==
2
:
try
:
self
.
reseted_components
=
[]
self
.
components
=
[]
self
.
_status
=
self
.
STATUS_STARTED
self
.
_postprocess_status
=
self
.
STATUS_PENDING
self
.
_serialize
()
self
.
wf_execution_wrapper
()
if
len
(
self
.
components_to_exec
)
>
0
:
self
.
_execute_weaver
()
self
.
__step
=
3
except
:
self
.
_status
=
self
.
STATUS_FAILED
self
.
end_time
=
time
.
time
()
self
.
_send_email
()
raise
finally
:
self
.
_serialize
()
self
.
reseted_components
=
[]
self
.
components
=
[]
self
.
_status
=
self
.
STATUS_STARTED
self
.
_postprocess_status
=
self
.
STATUS_PENDING
self
.
_serialize
()
self
.
wf_execution_wrapper
()
if
len
(
self
.
components_to_exec
)
>
0
:
self
.
_execute_weaver
()
self
.
__step
=
3
self
.
_serialize
()
# if post processing has ne been done yet
if
self
.
__step
==
3
:
try
:
...
...
@@ -889,14 +869,19 @@ class Workflow(threading.Thread):
except
:
self
.
_postprocess_status
=
self
.
STATUS_FAILED
raise
finally
:
self
.
end_time
=
time
.
time
()
self
.
_serialize
()
self
.
_send_email
()
self
.
end_time
=
time
.
time
()
self
.
_serialize
()
except
Exception
as
e
:
self
.
_status
=
self
.
STATUS_FAILED
self
.
end_time
=
time
.
time
()
if
self
.
__step
is
not
None
:
self
.
_serialize
()
self
.
_log
(
str
(
e
),
traceback
=
traceback
.
format_exc
(
chain
=
False
))
utils
.
display_error_message
(
str
(
e
))
finally
:
if
self
.
__step
is
not
None
:
self
.
_send_email
()
def
restart
(
self
):
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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