including the necessary things

This commit is contained in:
Kasper Rynning-Tønnesen
2019-10-07 16:26:57 +02:00
parent 9d9c783244
commit bc3328db2b

View File

@@ -4,7 +4,7 @@ var cluster = require("cluster"),
//publicPath = path.join(__dirname, 'public'), //publicPath = path.join(__dirname, 'public'),
http = require("http"), http = require("http"),
port = 8080, port = 8080,
//farmhash = require('farmhash'), farmhash = require("farmhash"),
uniqid = require("uniqid"), uniqid = require("uniqid"),
num_processes = require("os").cpus().length; num_processes = require("os").cpus().length;
@@ -53,7 +53,6 @@ function startClustered(redis_enabled) {
var worker_index = function(ip, len) { var worker_index = function(ip, len) {
//console.log(ip); //console.log(ip);
var s = ""; var s = "";
console.log("this is some ip shit", ip);
if (ip !== undefined) { if (ip !== undefined) {
return farmhash.fingerprint32(ip) % len; return farmhash.fingerprint32(ip) % len;
} }
@@ -68,8 +67,6 @@ function startClustered(redis_enabled) {
var server = net var server = net
.createServer({ pauseOnConnect: true }, function(connection, a) { .createServer({ pauseOnConnect: true }, function(connection, a) {
console.log("this is a connection");
console.log(connection.address().address);
var worker = var worker =
workers[worker_index(connection.address().address, num_processes)]; workers[worker_index(connection.address().address, num_processes)];
worker.send("sticky-session:connection", connection); worker.send("sticky-session:connection", connection);