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) {