Witness is called to update our local clock if necessary after witnessing a clock value received from another process
(time Time)
| 61 | // Witness is called to update our local clock if necessary after |
| 62 | // witnessing a clock value received from another process |
| 63 | func (pc *PersistedClock) Witness(time Time) error { |
| 64 | // TODO: rework so that we write only when the clock was actually updated |
| 65 | err := pc.MemClock.Witness(time) |
| 66 | if err != nil { |
| 67 | return err |
| 68 | } |
| 69 | return pc.Write() |
| 70 | } |
| 71 | |
| 72 | func (pc *PersistedClock) read() error { |
| 73 | f, err := pc.root.Open(pc.filePath) |