Skip to content

Commit

Permalink
Change default gc interval. (#1756)
Browse files Browse the repository at this point in the history
  • Loading branch information
efectn committed Feb 7, 2022
1 parent 68fcd8c commit 8bd1509
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/memory/memory.go
Expand Up @@ -23,7 +23,7 @@ func New() *Storage {
data: make(map[string]item),
ts: uint32(time.Now().Unix()),
}
go store.gc(10 * time.Millisecond)
go store.gc(1 * time.Second)
go store.updater(1 * time.Second)
return store
}
Expand Down

1 comment on commit 8bd1509

@abhi12299
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought, why do we need the store.updater goroutine? We can simply store the expiry time for every key as current time + ttl and then compare it later with the current time.. How is the store.ts helping?

Please sign in to comment.