node-cache
node-cache copied to clipboard
Is this a bug about `this.del` function
https://github.com/ptarjan/node-cache/blob/27a1eeec18660b45d39cc5daf44d9647e696e48b/index.js#L53
When a record is about to expire, we take the initiative to delete it. And due to the running time of the program, oldRecord.expire < Date.now() === true
, so the record will not be deleted.
Yeah, that seems silly to me. If you’re manually invoking a delete function then jr shouldn’t matter wether or not the record is expiring. It should delete it regardless
I think it’s an interesting idea to have a method that won't delete a key if it isn't expired. But it’s really strange when you don't have an opportunity to delete something that doesn’t expired. In my similar package memory-cache-pro you can use the ‘delete(key)’ method to delete something and it doesn’t check the key expiration time