Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
pycalibration
Commits
fdbf1d60
Commit
fdbf1d60
authored
3 years ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Send just one update to myMdC when correction finishes
parent
1093aa1a
No related branches found
No related tags found
1 merge request
!599
Don't send updates to myMdC when all jobs are pending
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webservice/webservice.py
+8
-7
8 additions, 7 deletions
webservice/webservice.py
with
8 additions
and
7 deletions
webservice/webservice.py
+
8
−
7
View file @
fdbf1d60
...
...
@@ -427,10 +427,6 @@ def update_job_db(config):
except
KafkaError
:
logging
.
warning
(
"
Error sending Kafka notification
"
,
exc_info
=
True
)
mdc
.
update_run_api
(
rid
,
# The result from MyMDC does not matter here.
{
'
cal_last_end_at
'
:
datetime
.
now
(
tz
=
timezone
.
utc
).
isoformat
()}
)
if
all
(
s
.
startswith
(
'
PD-
'
)
for
s
in
statii
):
# Avoid swamping myMdC with updates for jobs still pending.
...
...
@@ -443,14 +439,19 @@ def update_job_db(config):
msg
=
"
\n
"
.
join
(
statii
)
msg_debug
=
f
"
Update MDC
{
rid
}
,
{
msg
}
"
logging
.
debug
(
msg_debug
.
replace
(
'
\n
'
,
'
,
'
))
if
action
==
'
CORRECT
'
:
response
=
mdc
.
update_run_api
(
rid
,
{
'
flg_cal_data_status
'
:
flg
,
'
cal_pipeline_reply
'
:
msg
})
data
=
{
'
flg_cal_data_status
'
:
flg
,
'
cal_pipeline_reply
'
:
msg
}
if
flg
!=
'
R
'
:
data
[
'
cal_last_end_at
'
]
=
datetime
.
now
(
tz
=
timezone
.
utc
).
isoformat
()
response
=
mdc
.
update_run_api
(
rid
,
data
)
else
:
# action == 'DARK' but it's dark_request
data
=
{
'
dark_run
'
:
{
'
flg_status
'
:
dark_flags
[
flg
],
'
calcat_feedback
'
:
msg
}}
response
=
mdc
.
update_dark_run_api
(
rid
,
data
)
if
response
.
status_code
!=
200
:
logging
.
error
(
"
Failed to update MDC for action %s, rid %s
"
,
action
,
rid
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment