Minor fixes

This commit is contained in:
Calvin Montgomery 2018-02-15 19:59:23 -08:00
parent 49661a95ab
commit d5f5c91b05
4 changed files with 12 additions and 1 deletions

View File

@ -44,6 +44,10 @@ function initChannelDumper(Server) {
var CHANNEL_SAVE_INTERVAL = parseInt(Config.get("channel-save-interval")) var CHANNEL_SAVE_INTERVAL = parseInt(Config.get("channel-save-interval"))
* 60000; * 60000;
setInterval(function () { setInterval(function () {
if (Server.channels.length === 0) {
return;
}
var wait = CHANNEL_SAVE_INTERVAL / Server.channels.length; var wait = CHANNEL_SAVE_INTERVAL / Server.channels.length;
LOGGER.info(`Saving channels with delay ${wait}`); LOGGER.info(`Saving channels with delay ${wait}`);
Promise.reduce(Server.channels, (_, chan) => { Promise.reduce(Server.channels, (_, chan) => {

View File

@ -138,6 +138,10 @@ module.exports.query = function (query, sub, callback) {
}).catch(error => { }).catch(error => {
queryErrorCount.inc(1); queryErrorCount.inc(1);
if (!sub) {
sub = [];
}
let subs = JSON.stringify(sub); let subs = JSON.stringify(sub);
if (subs.length > 100) { if (subs.length > 100) {
subs = subs.substring(0, 100) + '...'; subs = subs.substring(0, 100) + '...';

View File

@ -28,6 +28,10 @@ const ECODE_MESSAGES = {
"The remote server's network is unreachable from this server. " + "The remote server's network is unreachable from this server. " +
"Please contact an administrator for assistance." "Please contact an administrator for assistance."
), ),
EHOSTUNREACH: e => (
"The remote server is unreachable from this server. " +
"Please contact the video server's administrator for assistance."
),
DEPTH_ZERO_SELF_SIGNED_CERT: e => ( DEPTH_ZERO_SELF_SIGNED_CERT: e => (
'The remote server provided an invalid ' + 'The remote server provided an invalid ' +

View File

@ -2,7 +2,6 @@
var fs = require("graceful-fs"); var fs = require("graceful-fs");
var path = require("path"); var path = require("path");
import { sprintf } from 'sprintf-js';
import { Logger as JsliLogger, LogLevel } from '@calzoneman/jsli'; import { Logger as JsliLogger, LogLevel } from '@calzoneman/jsli';
import jsli from '@calzoneman/jsli'; import jsli from '@calzoneman/jsli';