Skip to content

Commit

Permalink
still update global clock per 100ms
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu committed Jan 3, 2024
1 parent 53a77c3 commit 2a73afc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ func init() {
atomic.StoreUint32(&clock, uint32(time.Now().Unix()-unixBase))
go func() {
for {
time.Sleep(500 * time.Millisecond)
for i := 0; i < 9; i++ {
time.Sleep(100 * time.Millisecond)
atomic.StoreUint32(&clock, uint32(time.Now().Unix()-unixBase))
}
time.Sleep(100 * time.Millisecond)
atomic.StoreUint32(&clock, uint32(time.Now().Unix()-unixBase))
}
}()
Expand Down

0 comments on commit 2a73afc

Please sign in to comment.