From 7d35df4f5a97e23a3dca87e8c8e81353729229ed Mon Sep 17 00:00:00 2001 From: calzoneman Date: Wed, 7 Oct 2015 22:19:39 -0700 Subject: [PATCH] Fixes --- src/channel-storage/migrator.js | 2 +- src/database.js | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) 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) {