Blocked by Instagram.

This commit is contained in:
Cadence Fish
2020-01-30 16:05:43 +13:00
parent a5ab771969
commit e2fba3bbd0
9 changed files with 56 additions and 14 deletions

View File

@@ -55,7 +55,7 @@ class TtlCache {
*/
getTtl(key, factor = 1) {
if (this.has(key)) {
return Math.max((Math.floor(Date.now() - this.cache.get(key).time) / factor), 0)
return Math.max(Math.ceil((this.cache.get(key).time + this.ttl - Date.now()) / factor), 0)
} else {
return null
}