Skip to content

Commit

Permalink
fix: notify others when node is online
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiebens committed Apr 27, 2024
1 parent 5adec31 commit 3d21630
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/core/session_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3d21630

Please # to comment.