mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 01:40:24 +00:00
including the necessary things
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user