Polykey icon indicating copy to clipboard operation
Polykey copied to clipboard

`NodeManager` should update active connection's `connectedTime` in the `NodeGraph` on an interval

Open tegefaulkes opened this issue 1 year ago • 0 comments

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.

  1. Wait a configured delay.
  2. Iterate over all active connections in the NodeConnectionManager.
  3. If they have an entry in the NodeGraph then update the connectedTime for each connection.
  4. 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

  1. add background task in NodeManager to update the connectedTime for all active connections.
  2. Add tests to check this functionality.

tegefaulkes avatar Dec 04 '23 07:12 tegefaulkes