From 702c9a2fb2baf9104159d17982c087640807b29f Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 4 Sep 2019 14:38:44 +0200 Subject: [PATCH] drop chechChannelIntegrity API --- historyKeeper.js | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/historyKeeper.js b/historyKeeper.js index 89fed7e85..fc1f9948d 100644 --- a/historyKeeper.js +++ b/historyKeeper.js @@ -1,5 +1,5 @@ /* jshint esversion: 6 */ -/* global Buffer, process */ +/* global Buffer */ ;(function () { 'use strict'; const nThen = require('nthen'); @@ -1024,33 +1024,6 @@ module.exports.create = function (cfg) { } }; - var cciLock = false; - const checkChannelIntegrity = function (ctx) { - if (process.env['CRYPTPAD_DEBUG'] && !cciLock) { - let nt = nThen; - cciLock = true; - Object.keys(ctx.channels).forEach(function (channelName) { - const chan = ctx.channels[channelName]; - if (!chan.index) { return; } - nt = nt((waitFor) => { - store.getChannelSize(channelName, waitFor((err, size) => { - if (err) { - return void Log.debug("HK_CHECK_CHANNEL_INTEGRITY", - "Couldn't get size of channel " + channelName); - } - if (size !== chan.index.size) { - return void Log.debug("HK_CHECK_CHANNEL_SIZE", - "channel size mismatch for " + channelName + - " --- cached: " + chan.index.size + - " --- fileSize: " + size); - } - })); - }).nThen; - }); - nt(() => { cciLock = false; }); - } - }; - return { id: HISTORY_KEEPER_ID, setConfig: setConfig, @@ -1058,7 +1031,6 @@ module.exports.create = function (cfg) { dropChannel: dropChannel, checkExpired: checkExpired, onDirectMessage: onDirectMessage, - checkChannelIntegrity: checkChannelIntegrity }; };