Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict'
var cluster = require('cluster');
var EventEmitter = require('events').EventEmitter;
var cpuCount = require('os').cpus().length;
const cache = require('microgateway-plugins').memored;
const writeConsoleLog = require('microgateway-core').Logging.writeConsoleLog;
const CONSOLE_LOG_TAG_COMP = 'microgateway reload cluster';
const specialLists = require('./util/item-managers')
const PURGE_INTERVAL = 60000;
//
const DEFAULT_PROCESS_CHECK_INTERVAL = 10000
const RAPID_REPLAY_INTERVAL_STOPPED_PROCESSES = 50
const CALLBACK_TIMEOUT = 5000
const MAX_CONNECT_FAIL_TIME = 200
const WORKER_CHECKSTATUS_INTERVAL = 100
const WORKER_FORCEKILL_TIMEOUT = 1000 * 180 // 3 minutes
//
var RLC = null; // an instance if needed
refreshCache() {
cache.clean(function(){});
}
initializeCache() {
//setup memored - a cache shared between worker processes. intro in 2.5.9
cache.setup({
purgeInterval: PURGE_INTERVAL
});
}