Polykey
Polykey copied to clipboard
`NodeManager` should update active connection's `connectedTime` in the `NodeGraph` on an interval
Specification
Currently the connectedTime
for an entry in the NodeGraph
is whatever was provided when it was first added. Ideally this should reflect the last moment we saw it, not the first moment we connected to it.
To fix this we need to add functionality to the NodeGraph
where we do the following.
- Wait a configured delay.
- Iterate over all active connections in the
NodeConnectionManager
. - If they have an entry in the
NodeGraph
then update theconnectedTime
for each connection. - reschedule the task for the configured delay
This will run as a background task using the TaskManager
. I don't like having background tasks running for most tests. So I suggest there should be a way to disable this task for testing.
Additional context
- related #618
Tasks
- add background task in
NodeManager
to update theconnectedTime
for all active connections. - Add tests to check this functionality.