mirror of
https://github.com/KevinMidboe/zoff.git
synced 2026-01-10 19:45:34 +00:00
Timeout api, and fixes it lead to
- timeout on api-calls with Retry-After present in header - Fixed issue where when server restarts you are sometimes logged out for some reason - README updates
This commit is contained in:
@@ -10,7 +10,7 @@ var mongojs = require('mongojs');
|
||||
var db = mongojs('mongodb://' + mongo_config.host + '/' + mongo_config.config);
|
||||
|
||||
db.collection("chat_logs").createIndex({ "createdAt": 1 }, { expireAfterSeconds: 600 });
|
||||
|
||||
db.collection("timeout_api").createIndex({ "createdAt": 1 }, { expireAfterSeconds: 5 });
|
||||
db.on('connected', function(err) {
|
||||
console.log("connected");
|
||||
})
|
||||
|
||||
@@ -282,18 +282,6 @@ module.exports = function() {
|
||||
|
||||
socket.on('skip', function(list)
|
||||
{
|
||||
if(coll !== undefined) {
|
||||
try {
|
||||
coll = list.channel;
|
||||
if(coll.length == 0) return;
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = coll.replace("_", "");
|
||||
coll = encodeURIComponent(coll).replace(/\W/g, '');
|
||||
coll = filter.clean(coll);
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
List.skip(list, guid, coll, offline, socket);
|
||||
});
|
||||
|
||||
|
||||
@@ -77,10 +77,18 @@ function skip(list, guid, coll, offline, socket) {
|
||||
|
||||
if(list !== undefined && list !== null && list !== "")
|
||||
{
|
||||
|
||||
if(coll == "" || coll == undefined || coll == null) {
|
||||
socket.emit("update_required");
|
||||
return;
|
||||
if(coll == undefined && list.hasOwnProperty('channel')) coll = list.channel;
|
||||
if(coll !== undefined) {
|
||||
try {
|
||||
coll = list.channel;
|
||||
if(coll.length == 0) return;
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = coll.replace("_", "");
|
||||
coll = encodeURIComponent(coll).replace(/\W/g, '');
|
||||
coll = filter.clean(coll);
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(typeof(list.pass) != "string" || typeof(list.id) != "string" ||
|
||||
typeof(list.channel) != "string" || typeof(list.userpass) != "string") {
|
||||
|
||||
@@ -22,7 +22,6 @@ function password(inp, coll, guid, offline, socket) {
|
||||
uncrypted = pw;
|
||||
pw = Functions.decrypt_string(socket.zoff_id, pw);
|
||||
Functions.check_inlist(coll, guid, socket, offline);
|
||||
|
||||
if(inp.oldpass)
|
||||
{
|
||||
opw = inp.oldpass;
|
||||
|
||||
Reference in New Issue
Block a user