mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
including the necessary things
This commit is contained in:
@@ -4,7 +4,7 @@ var cluster = require("cluster"),
|
||||
//publicPath = path.join(__dirname, 'public'),
|
||||
http = require("http"),
|
||||
port = 8080,
|
||||
//farmhash = require('farmhash'),
|
||||
farmhash = require("farmhash"),
|
||||
uniqid = require("uniqid"),
|
||||
num_processes = require("os").cpus().length;
|
||||
|
||||
@@ -53,7 +53,6 @@ function startClustered(redis_enabled) {
|
||||
var worker_index = function(ip, len) {
|
||||
//console.log(ip);
|
||||
var s = "";
|
||||
console.log("this is some ip shit", ip);
|
||||
if (ip !== undefined) {
|
||||
return farmhash.fingerprint32(ip) % len;
|
||||
}
|
||||
@@ -68,8 +67,6 @@ function startClustered(redis_enabled) {
|
||||
|
||||
var server = net
|
||||
.createServer({ pauseOnConnect: true }, function(connection, a) {
|
||||
console.log("this is a connection");
|
||||
console.log(connection.address().address);
|
||||
var worker =
|
||||
workers[worker_index(connection.address().address, num_processes)];
|
||||
worker.send("sticky-session:connection", connection);
|
||||
|
||||
Reference in New Issue
Block a user