Prevent possible download counter race condition

This commit is contained in:
Robert 2019-04-19 13:10:49 +02:00
parent ee45a835be
commit f94918bebd
2 changed files with 5 additions and 1 deletions

View file

@ -62,6 +62,10 @@ class DB {
this.redis.hset(id, key, value);
}
incrementField(id, key, increment = 1) {
this.redis.hincrby(id, key, increment);
}
async del(id) {
const filePath = await this.getPrefixedId(id);
this.storage.del(filePath);