Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
Discovery
makes use of TaskManager
now
- The parts of discovery that handles queuing has been removed. This includes the 'plug' promises, database levels and the discovery ID generator. - The logic of the queue where it handled the vertex was separated out into a new method. This logic included connecting to a vertex, getting the claims' data, iterating over the claims, verifying the claims and adding them to the gestaltGraph, and adding the new vertices to the list. - Adding a vertex to the list now consists of creating a singleton task. each task focuses on processing a single vertex. - I tried to cancel all tasks on `discovery.destroy()` but it would require the `taskManager` to be started at the time since we need to iterate over active tasks at the time. For now cancel the tasks when starting with fresh. - To avoid re-trying tasks, a `visitedVertices` set is used, this hasn't been updated. A more complex mechanism is need for this that has persistence. I think this will be left with the more complex discovery changes later. - Discovery tests have been updated. none removed or added so far. The change was just using `taskManager`. - Removed discovery utils and types. These are not needed anymore since we don't make use of a discovery ID generator. - Added locking on the vertex to avoid duplicating a task due to racing. Also catching and throwing the singleton reason, so we don't get any errors on tasks that were canceled for this reason. - Discovery tasks are canceled during fresh start and destroy. -`Discovery` stops any active tasks when stopping - Added a check for if `TaskManager` is still processing when calling stop on `Discovery` and `NodeManager`.
- Loading branch information