Sweep caches more frequently

This commit is contained in:
Cadence Fish 2020-03-18 21:14:12 +13:00
parent 3efc4928a5
commit 9a416a643b
No known key found for this signature in database
GPG Key ID: 81015DF9AA8607E1
2 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,5 @@
const constants = require("./constants")
/**
* @template T
*/
@ -11,7 +13,7 @@ class TtlCache {
this.cache = new Map()
this.sweepInterval = setInterval(() => {
this.clean()
}, this.ttl)
}, constants.caching.cache_sweep_interval)
}
clean() {

View File

@ -38,6 +38,7 @@ let constants = {
resource_cache_time: 30*60*1000,
instance_list_cache_time: 3*60*1000,
updater_cache_time: 2*60*1000,
cache_sweep_interval: 3*60*1000,
db_user_id: true,
db_post_n3: true
},