gotd: add time synchronization

This commit is contained in:
Tulir Asokan
2026-02-26 18:24:48 +02:00
parent 93fe3cb0ea
commit 6af986ded5
15 changed files with 110 additions and 48 deletions
+6
View File
@@ -152,6 +152,12 @@ func (g *MessageIDGen) New(t MessageType) int64 {
return int64(NewMessageIDNano(g.nano, t))
}
func (g *MessageIDGen) Reset() {
g.mux.Lock()
g.nano = 0
g.mux.Unlock()
}
// NewMessageIDGen creates new message id generator.
//
// Current time will be provided by now() function.