Add endpoint which can gather extra rsyncer information#545
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #545 +/- ##
=======================================
Coverage 28.95% 28.96%
=======================================
Files 80 80
Lines 10449 10495 +46
Branches 1391 1394 +3
=======================================
+ Hits 3026 3040 +14
- Misses 7322 7354 +32
Partials 101 101 🚀 New features to boost your workflow:
|
9d896fa to
58129f9
Compare
src/murfey/server/api/instrument.py
Outdated
| token = instrument_server_tokens[session_id]["access_token"] | ||
| async with aiohttp.ClientSession() as clientsession: | ||
| async with clientsession.get( | ||
| f"{machine_config.instrument_server_url}/sessions/{sanitise(str(session_id))}/rsyncer_info", |
There was a problem hiding this comment.
Feel free to remove the sanitise(str()) call, as Pydantic already evaluates this.
| ) as resp: | ||
| data = await resp.json() | ||
| except KeyError: | ||
| data = [] |
There was a problem hiding this comment.
Maybe add a debug/warning log, in case it's not performing what we expected?
There was a problem hiding this comment.
In this case this is to catch the case where the instrument server has disconnected. Then I want data to be [] so it can be handled below and lead to a display in the web UI that indicates the rsyncers aren't running. I can add one to catch other exceptions
tieneupin
left a comment
There was a problem hiding this comment.
Some suggestions, but otherwise no obvious errors!
Including how many files are queued for transfer and whether the rsync thread is alive