diff --git a/src/channel-storage/migrator.js b/src/channel-storage/migrator.js index 25ae82ef..fc70ee86 100644 --- a/src/channel-storage/migrator.js +++ b/src/channel-storage/migrator.js @@ -140,7 +140,7 @@ function migrate(src, dest) { }).catch(err => { console.error(`Failed to migrate /r/${name}: ${err.stack}`); }); - }); + }, 0); }); } diff --git a/src/database.js b/src/database.js index d6c23bef..c26883ee 100644 --- a/src/database.js +++ b/src/database.js @@ -3,7 +3,6 @@ var bcrypt = require("bcrypt"); var $util = require("./utilities"); var Logger = require("./logger"); var Config = require("./config"); -var Server = require("./server"); var tables = require("./database/tables"); var net = require("net"); var util = require("./utilities"); @@ -556,11 +555,6 @@ module.exports.listStats = function (callback) { /* Misc */ module.exports.loadAnnouncement = function () { - // Temporary workaround - if (!Server.getServer || !Server.getServer()) { - return; - } - var query = "SELECT * FROM `meta` WHERE `key`='announcement'"; module.exports.query(query, function (err, rows) { if (err) { @@ -581,6 +575,11 @@ module.exports.loadAnnouncement = function () { return; } + var Server = require("./server"); + if (!Server.getServer || !Server.getServer()) { + return; + } + var sv = Server.getServer(); sv.announcement = announcement; for (var id in sv.ioServers) {