resource set: limit.available cannot be > limit.total.
This commit is contained in:
parent
fd41f8def6
commit
651a27b558
@ -234,8 +234,8 @@ export default class {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((limit.available += quantity) > limits.total) {
|
if ((limit.available += quantity) > limit.total) {
|
||||||
throw new Error(`cannot release ${quantity} ${id} in the set ${setId}`)
|
limit.available = limit.total
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
await this._save(set)
|
await this._save(set)
|
||||||
|
Loading…
Reference in New Issue
Block a user