This commit is contained in:
Cadence Fish
2020-01-15 03:38:33 +13:00
parent b5f163891c
commit 30b45c2573
17 changed files with 157 additions and 26 deletions

View File

@@ -22,6 +22,10 @@ class InstaCache {
return this.cache.get(key).data
}
getTtl(key, factor = 1) {
return Math.max((Math.floor(Date.now() - this.cache.get(key).time) / factor), 0)
}
/**
* @param {string} key
* @param {any} data