Skip to content
Snippets Groups Projects
Commit 8c471cb3 authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Fixed trying to read build from RocketChat.Info when it is not available.

parent ea388604
No related merge requests found
......@@ -302,6 +302,7 @@ Migrations._migrateTo = function(version, rerun) {
function lock() {
const date = new Date();
const dateMinusInterval = moment(date).subtract(self.options.lockExpiration, 'minutes').toDate();
const build = RocketChat.Info ? RocketChat.Info.build.date : date;
// This is atomic. The selector ensures only one caller at a time will see
// the unlocked control, and locking occurs in the same update's modifier.
......@@ -316,14 +317,14 @@ Migrations._migrateTo = function(version, rerun) {
}
}, {
buildAt: {
$ne: RocketChat.Info.build.date
$ne: build
}
}]
}, {
$set: {
locked: true,
lockedAt: date,
buildAt: RocketChat.Info.build.date
buildAt: build
}
}) === 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment