I have the following code:
myTable()
.update(data, {
where: criteria
})
.then(delay(100))
.then((entries) => {
...
...
The .then(delay(100)) part sets a delay of 100ms.
If i don't use that delay, sometimes entries (the resulted updated rows) aren't correct, meaning - their fields were not updated. But sometimes they are.
If i'm using the delay, the content of entries is always correct.
So my question is - what's going on here? Why do i have to set a delay in order for it to work?
from Sequelize - 'update' doesn't work without a delay
No comments:
Post a Comment