From 3d21630bf33e93994a9d39beb1c47834a207a8e6 Mon Sep 17 00:00:00 2001 From: Johan Siebens Date: Sat, 27 Apr 2024 09:21:40 +0200 Subject: [PATCH] fix: notify others when node is online --- internal/core/session_manager.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/core/session_manager.go b/internal/core/session_manager.go index 6f18c411..38b6f825 100644 --- a/internal/core/session_manager.go +++ b/internal/core/session_manager.go @@ -43,6 +43,16 @@ func (n *pollMapSessionManager) Register(tailnetID uint64, machineID uint64, ch t.Stop() delete(n.timers, machineID) } + + timer := time.NewTimer(5 * time.Second) + go func() { + <-timer.C + if n.HasSession(tailnetID, machineID) { + n.NotifyAll(tailnetID, machineID) + } + }() + + n.timers[machineID] = timer } func (n *pollMapSessionManager) Deregister(tailnetID uint64, machineID uint64) {