Browse Source

Disable build stats on web interface temporarily

dev
webworker01 6 years ago
parent
commit
5856e0a63f
No known key found for this signature in database GPG Key ID: 7C4B4F666DB24C9F
  1. 17
      init.js
  2. 8
      libs/website.js

17
init.js

@ -93,7 +93,6 @@ var buildPoolConfigs = function(){
var poolConfigFiles = [];
/* Get filenames of pool config json files that are enabled */
fs.readdirSync(configDir).forEach(function(file){
if (!fs.existsSync(configDir + file) || path.extname(configDir + file) !== '.json') return;
@ -103,7 +102,6 @@ var buildPoolConfigs = function(){
poolConfigFiles.push(poolOptions);
});
/* Ensure no pool uses any of the same ports as another pool */
for (var i = 0; i < poolConfigFiles.length; i++){
var ports = Object.keys(poolConfigFiles[i].ports);
@ -127,7 +125,6 @@ var buildPoolConfigs = function(){
}
}
poolConfigFiles.forEach(function(poolOptions){
poolOptions.coinFileName = poolOptions.coin;
@ -165,7 +162,6 @@ var buildPoolConfigs = function(){
}
}
configs[poolOptions.coin.name] = poolOptions;
if (!(coinProfile.algorithm in algos)){
@ -215,7 +211,6 @@ var spawnPoolWorkers = function(){
return;
}
var serializedConfigs = JSON.stringify(poolConfigs);
var numForks = (function(){
@ -326,7 +321,6 @@ var spawnPoolWorkers = function(){
};
var startCliListener = function(){
var cliPort = portalConfig.cliPort;
@ -359,7 +353,6 @@ var startCliListener = function(){
}).start();
};
var processCoinSwitchCommand = function(params, options, reply){
var logSystem = 'CLI';
@ -400,13 +393,11 @@ var processCoinSwitchCommand = function(params, options, reply){
return;
}
var switchNames = [];
if (params[1]) {
switchNames.push(params[1]);
}
else{
} else {
for (var name in portalConfig.switching){
if (portalConfig.switching[name].enabled && portalConfig.switching[name].algorithm === options.algorithm)
switchNames.push(name);
@ -427,11 +418,8 @@ var processCoinSwitchCommand = function(params, options, reply){
});
reply('Switch message sent to pool workers');
};
var startPaymentProcessor = function(){
var enabledForAny = false;
@ -477,7 +465,6 @@ var startWebsite = function(){
});
};
var startProfitSwitch = function(){
if (!portalConfig.profitSwitch || !portalConfig.profitSwitch.enabled){
@ -498,8 +485,6 @@ var startProfitSwitch = function(){
});
};
(function init(){
poolConfigs = buildPoolConfigs();

8
libs/website.js

@ -16,7 +16,6 @@ var compress = require('compression');
var api = require('./api.js');
module.exports = function(logger){
dot.templateSettings.strip = false;
@ -91,7 +90,6 @@ module.exports = function(logger){
});
};
// if an html file was changed reload it
/* requires node-watch 0.5.0 or newer */
watch(['./website', './website/pages'], function(evt, filename){
@ -121,11 +119,10 @@ module.exports = function(logger){
var res = portalApi.liveStatConnections[uid];
res.write(statData);
}
});
};
setInterval(buildUpdatedWebsite, websiteConfig.stats.updateInterval * 1000);
//setInterval(buildUpdatedWebsite, websiteConfig.stats.updateInterval * 1000);
var getPage = function(pageId){
if (pageId in pageProcessed){
@ -164,7 +161,6 @@ module.exports = function(logger){
portalStats.getCoins(function(){
processTemplates();
res.end(indexesProcessed['user_shares']);
});
};
@ -264,6 +260,4 @@ module.exports = function(logger){
logger.error(logSystem, 'Server', 'Could not start website on ' + portalConfig.website.host + ':' + portalConfig.website.port
+ ' - its either in use or you do not have permission');
}
};

Loading…
Cancel
Save