Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ChEMBL
C
ChEMBL
Delayed Jobs
Delayed Jobs API
Commits
bb3cf34c
Commit
bb3cf34c
authored
Apr 06, 2021
by
David Mendez
Browse files
Status Daemon: only write to log output and error of script if there was an error
parent
2bf11658
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
app/job_status_daemon/daemon.py
app/job_status_daemon/daemon.py
+6
-6
No files found.
app/job_status_daemon/daemon.py
View file @
bb3cf34c
...
...
@@ -154,12 +154,6 @@ def get_status_script_output(job_id, checker_name, script_path):
delayed_job_models
.
append_to_lsf_check_log
(
job_id
,
checker_name
,
check_msg
)
status_check_process
=
subprocess
.
run
(
run_command
.
split
(
' '
),
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
check_msg
=
f
'Output:
\n
{
status_check_process
.
stdout
}
'
delayed_job_models
.
append_to_lsf_check_log
(
job_id
,
checker_name
,
check_msg
)
check_msg
=
f
'Error:
\n
{
status_check_process
.
stderr
}
'
delayed_job_models
.
append_to_lsf_check_log
(
job_id
,
checker_name
,
check_msg
)
return_code
=
status_check_process
.
returncode
check_msg
=
f
'script return code was:
{
return_code
}
'
delayed_job_models
.
append_to_lsf_check_log
(
job_id
,
checker_name
,
check_msg
)
...
...
@@ -180,6 +174,12 @@ def get_status_script_output(job_id, checker_name, script_path):
check_msg
=
f
'There was an error when running the job status script! Check the directory
{
script_path
}
for logs!'
delayed_job_models
.
append_to_lsf_check_log
(
job_id
,
checker_name
,
check_msg
)
check_msg
=
f
'Output:
\n
{
status_check_process
.
stdout
}
'
delayed_job_models
.
append_to_lsf_check_log
(
job_id
,
checker_name
,
check_msg
)
check_msg
=
f
'Error:
\n
{
status_check_process
.
stderr
}
'
delayed_job_models
.
append_to_lsf_check_log
(
job_id
,
checker_name
,
check_msg
)
raise
JobStatusDaemonError
(
'There was an error when running the job status script! Please check the logs'
)
else
:
return
status_check_process
.
stdout
.
decode
()
...
...
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