Added communication between Serve and CLI using KV table #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The in-memory
clientsPolling
map is only available from the Headscale process serving the API. This means that some changes performed by the CLI (which is a different process) are not propagated immediately to the polling clients.This is what is happening in #52. Nodes are successfully removed from the DB, but the connected machines do not receive an updated node
Map
until their client decides to close the long poll and reconnect.I have added a new worker that polls the KV table we had since the beginning in Headscale DB schema. Namespaces whose nodes should be sent an updated map are added to the
namespaces_pending_updates
key.The hardcoded polling time is 5000 msecs.