mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-15 21:52:25 +03:00
Replace deprecated prometheus.InstrumentHandler and unsafe time.Ticker
This commit is contained in:
parent
e959927d0a
commit
8fb2c9c33c
5 changed files with 124 additions and 34 deletions
|
@ -85,7 +85,7 @@ func (t *Cache) AddTransaction(accessToken, txnID string, res *util.JSONResponse
|
|||
// It guarantees that an entry will be present in cache for at least cleanupPeriod & at most 2 * cleanupPeriod.
|
||||
// This cycles the txnMaps forward, i.e. back map is assigned the front and front is assigned an empty map.
|
||||
func cacheCleanService(t *Cache) {
|
||||
ticker := time.Tick(t.cleanupPeriod)
|
||||
ticker := time.NewTicker(t.cleanupPeriod).C
|
||||
for range ticker {
|
||||
t.Lock()
|
||||
t.txnsMaps[1] = t.txnsMaps[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue