addNote adds a notification to the synchronisation session. If the notes channel is full the session is marked as desynchronised and the notification is discarded.
(note *SyncNote)
| 210 | // channel is full the session is marked as desynchronised and the notification |
| 211 | // is discarded. |
| 212 | func (ss *syncSession) addNote(note *SyncNote) { |
| 213 | select { |
| 214 | case ss.notes <- note: |
| 215 | default: |
| 216 | ss.Lock() |
| 217 | if !ss.desync { |
| 218 | log.Warningf("Sync session with %v is desynchronised", ss.node) |
| 219 | ss.desync = true |
| 220 | } |
| 221 | ss.Unlock() |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | // syncServer encapsulates the data for a synchronisation server. |
| 226 | type syncServer struct { |