summaryrefslogtreecommitdiff
path: root/lib/history.js
diff options
context:
space:
mode:
authorWu Cheng-Han2016-12-18 22:52:30 +0800
committerWu Cheng-Han2016-12-18 22:52:30 +0800
commit62eccd48e591fac2774032330ee03a2e60df00b5 (patch)
treefd75cdec5f48ad2802c2210c559fc9a50384745e /lib/history.js
parentbe3aa3bfd50859ca8a310130a99f977fa7537246 (diff)
Try to fix when server have heavy loading cache might not update to db properly
Diffstat (limited to 'lib/history.js')
-rw-r--r--lib/history.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/history.js b/lib/history.js
index 4a3bbe1e..2723422c 100644
--- a/lib/history.js
+++ b/lib/history.js
@@ -27,10 +27,10 @@ var updater = setInterval(function () {
if (cache.isDirty) {
if (config.debug) logger.info("history updater found dirty history: " + key);
var history = parseHistoryToArray(cache.history);
+ cache.isDirty = false;
finishUpdateHistory(key, history, function (err, count) {
if (err) return callback(err, null);
if (!count) return callback(null, null);
- cache.isDirty = false;
cache.updateAt = Date.now();
return callback(null, null);
});