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
03052b83
Commit
03052b83
authored
4 years ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
More logging
parent
c1c6b7ff
No related branches found
No related tags found
1 merge request
!441
Refactor 'webservice' ZMQ server
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webservice/webservice.py
+5
-0
5 additions, 0 deletions
webservice/webservice.py
with
5 additions
and
0 deletions
webservice/webservice.py
+
5
−
0
View file @
03052b83
...
@@ -389,6 +389,7 @@ async def update_job_db(config):
...
@@ -389,6 +389,7 @@ async def update_job_db(config):
'
calcat_feedback
'
:
msg
}}
'
calcat_feedback
'
:
msg
}}
response
=
mdc
.
update_dark_run_api
(
rid
,
data
)
response
=
mdc
.
update_dark_run_api
(
rid
,
data
)
if
response
.
status_code
!=
200
:
if
response
.
status_code
!=
200
:
logging
.
error
(
"
Failed to update MDC for action %s, rid %s
"
,
action
,
rid
)
logging
.
error
(
Errors
.
MDC_RESPONSE
.
format
(
response
))
logging
.
error
(
Errors
.
MDC_RESPONSE
.
format
(
response
))
except
Exception
as
e
:
except
Exception
as
e
:
e
=
str
(
e
)
e
=
str
(
e
)
...
@@ -519,6 +520,8 @@ async def wait_transfers(wait_runs: List[str], in_folder: str, proposal: str):
...
@@ -519,6 +520,8 @@ async def wait_transfers(wait_runs: List[str], in_folder: str, proposal: str):
"""
"""
all_transfers
=
[]
all_transfers
=
[]
logging
.
debug
(
"
Waiting for: propsal %s, runs %s
"
,
proposal
,
wait_runs
)
# FIXME: this loop should be an asyncio.gather
# FIXME: this loop should be an asyncio.gather
for
runnr
in
wait_runs
:
for
runnr
in
wait_runs
:
rpath
=
"
{}/r{:04d}/
"
.
format
(
in_folder
,
int
(
runnr
))
rpath
=
"
{}/r{:04d}/
"
.
format
(
in_folder
,
int
(
runnr
))
...
@@ -675,6 +678,7 @@ class ActionsServer:
...
@@ -675,6 +678,7 @@ class ActionsServer:
logging
.
error
(
"
Unexpected error handling request
"
,
exc_info
=
e
)
logging
.
error
(
"
Unexpected error handling request
"
,
exc_info
=
e
)
resp
=
Errors
.
OTHER_ERROR
.
format
(
e
).
encode
()
resp
=
Errors
.
OTHER_ERROR
.
format
(
e
).
encode
()
logging
.
debug
(
"
Sending response: %r
"
,
resp
)
await
self
.
socket
.
send
(
resp
)
await
self
.
socket
.
send
(
resp
)
async
def
handle_one_req
(
self
,
req
:
List
[
bytes
])
->
bytes
:
async
def
handle_one_req
(
self
,
req
:
List
[
bytes
])
->
bytes
:
...
@@ -695,6 +699,7 @@ class ActionsServer:
...
@@ -695,6 +699,7 @@ class ActionsServer:
logging
.
warning
(
Errors
.
UNKNOWN_ACTION
.
format
(
action
))
logging
.
warning
(
Errors
.
UNKNOWN_ACTION
.
format
(
action
))
return
Errors
.
UNKNOWN_ACTION
.
format
(
action
).
encode
()
return
Errors
.
UNKNOWN_ACTION
.
format
(
action
).
encode
()
logging
.
info
(
"
Handling request for action %s
"
,
action
)
logging
.
debug
(
'
Running action %s, payload %r
'
,
action
,
payload
)
logging
.
debug
(
'
Running action %s, payload %r
'
,
action
,
payload
)
handler
=
getattr
(
self
,
'
handle_
'
+
action
.
replace
(
'
-
'
,
'
_
'
))
handler
=
getattr
(
self
,
'
handle_
'
+
action
.
replace
(
'
-
'
,
'
_
'
))
...
...
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