MCPcopy Index your code
hub / github.com/google/seesaw / run

Method run

engine/sync.go:313–329  ·  view source on GitHub ↗

run runs the synchronisation server, which is responsible for queueing heartbeat notifications and removing expired synchronisation sessions.

()

Source from the content-addressed store, hash-verified

311// run runs the synchronisation server, which is responsible for queueing
312// heartbeat notifications and removing expired synchronisation sessions.
313func (s *syncServer) run() {
314 for now := range time.Tick(s.heartbeatInterval) {
315 s.sessionLock.Lock()
316 for id, ss := range s.sessions {
317 ss.RLock()
318 expiry := ss.expiryTime
319 ss.RUnlock()
320 if now.After(expiry) {
321 log.Warningf("Sync session %d with %v has expired", id, ss.node)
322 delete(s.sessions, id)
323 continue
324 }
325 ss.addNote(&SyncNote{Type: SNTHeartbeat, Time: now})
326 }
327 s.sessionLock.Unlock()
328 }
329}
330
331// syncClient contains the data needed by a synchronisation client.
332type syncClient struct {

Callers

nothing calls this directly

Calls 1

addNoteMethod · 0.80

Tested by

no test coverage detected