Only delete image job after time limit if it's finished

This commit is contained in:
TheEssem 2021-04-21 12:36:59 -05:00
parent 7bd3fc2791
commit e33d7fca5b

View file

@ -15,7 +15,7 @@ class JobCache extends Map {
set(key, value) {
super.set(key, value);
setTimeout(() => {
if (super.has(key) && this.get(key) === value) super.delete(key);
if (super.has(key) && this.get(key) === value && value.data) super.delete(key);
}, 300000); // delete jobs if not requested after 5 minutes
}
}