MCPcopy Create free account
hub / github.com/git-bug/git-bug / Witness

Method Witness

util/lamport/persisted_clock.go:63–70  ·  view source on GitHub ↗

Witness is called to update our local clock if necessary after witnessing a clock value received from another process

(time Time)

Source from the content-addressed store, hash-verified

61// Witness is called to update our local clock if necessary after
62// witnessing a clock value received from another process
63func (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
72func (pc *PersistedClock) read() error {
73 f, err := pc.root.Open(pc.filePath)

Callers

nothing calls this directly

Calls 2

WriteMethod · 0.95
WitnessMethod · 0.65

Tested by

no test coverage detected