我有以下代码:
myTable()
.update(data, {
where: criteria
})
.then(delay(100))
.then((entries) => {
...
...
.then(delay(100))
部分设置了 100 毫秒的延迟。
如果我不使用该延迟,有时 entries
(结果更新的行)不正确,这意味着它们的字段没有更新。但有时他们是。
如果我使用延迟,entries
的内容总是正确的。
为什么我必须设置延迟才能工作?
我本地的 MySQL my.cnf
文件:
[mysqld]
general_log_file = /var/log/mysql.log
general_log = 1
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
innodb_file_per_table = 1
innodb_log_file_size = 100M
interactive_timeout = 32000
lock_wait_timeout = 41536000
net_read_timeout = 120
net_write_timeout = 900
wait_timeout = 32000
max_allowed_packet = 1G
innodb_buffer_pool_size = 1G
在表架构和模型方面:
它有几个 double
列,一对 datetime
和 char
,一个 json
列和一个 枚举
列。
它们在模型中的定义相同。
最佳答案
关于javascript - 没有延迟, 'update' 不会触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52898928/