Change revision saving policy period

This commit is contained in:
Wu Cheng-Han 2016-10-15 13:54:16 +08:00
parent dbd7449740
commit 1e6de0b90e
1 changed files with 2 additions and 2 deletions

View File

@ -208,10 +208,10 @@ module.exports = function (sequelize, DataTypes) {
if (note.lastchangeAt && note.savedAt) { if (note.lastchangeAt && note.savedAt) {
var lastchangeAt = moment(note.lastchangeAt); var lastchangeAt = moment(note.lastchangeAt);
var savedAt = moment(note.savedAt); var savedAt = moment(note.savedAt);
if (moment().isAfter(lastchangeAt.add(1, 'minutes'))) { if (moment().isAfter(lastchangeAt.add(5, 'minutes'))) {
savedNotes.push(note); savedNotes.push(note);
Revision.saveNoteRevision(note, _callback); Revision.saveNoteRevision(note, _callback);
} else if (lastchangeAt.isAfter(savedAt.add(2, 'minutes'))) { } else if (lastchangeAt.isAfter(savedAt.add(10, 'minutes'))) {
savedNotes.push(note); savedNotes.push(note);
Revision.saveNoteRevision(note, _callback); Revision.saveNoteRevision(note, _callback);
} else { } else {