farmhash for worker-id, and prefix fix on firefox

This commit is contained in:
Kasper Rynning-Tønnesen
2018-05-09 12:26:22 +02:00
parent ee19212c81
commit 8e5624be17
4 changed files with 1198 additions and 729 deletions

1910
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -38,6 +38,7 @@
"express-recaptcha": "^3.0.1",
"express-session": "^1.15.6",
"express-sessions": "^1.0.6",
"farmhash": "^2.1.0",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.1",
"gulp-uglifyjs": "^0.6.2",

View File

@@ -4,6 +4,7 @@ path = require('path'),
//publicPath = path.join(__dirname, 'public'),
http = require('http'),
port = 8080,
farmhash = require('farmhash'),
num_processes = require('os').cpus().length;
publicPath = path.join(__dirname, 'public');
@@ -46,13 +47,7 @@ function startClustered(redis_enabled) {
}
var worker_index = function(ip, len) {
var s = '';
for (var i = 0, _len = ip.length; i < _len; i++) {
if (!isNaN(ip[i])) {
s += ip[i];
}
}
return Number(s) % len;
return farmhash.fingerprint32(ip) % len;
};
var server = net.createServer({ pauseOnConnect: true }, function(connection, a) {

View File

@@ -1365,10 +1365,15 @@ margin:-1px;
margin-left: 0px !important;
}
.input-field .prefix
{
position: relative !important;
}
.channel-finder .input-field .prefix{
color:white;
font-size:17px;
left: 5px;
left: 47px;
top: -9px;
}