Prevent possible download counter race condition
This commit is contained in:
parent
ee45a835be
commit
f94918bebd
2 changed files with 5 additions and 1 deletions
|
@ -34,7 +34,7 @@ module.exports = async function(req, res) {
|
|||
if (dl >= dlimit) {
|
||||
await storage.del(id);
|
||||
} else {
|
||||
await storage.setField(id, 'dl', dl);
|
||||
await storage.incrementField(id, 'dl');
|
||||
}
|
||||
} catch (e) {
|
||||
log.info('StorageError:', id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue