diff --git a/frappe/__init__.py b/frappe/__init__.py index f940f76f6e..9e812e00c2 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -13,7 +13,7 @@ import os, sys, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template -__version__ = '8.0.40' +__version__ = '8.0.41' __title__ = "Frappe Framework" local = Local() diff --git a/socketio.js b/socketio.js index 16fb642a80..3b43fa7e04 100644 --- a/socketio.js +++ b/socketio.js @@ -7,6 +7,7 @@ var redis = require("redis"); var request = require('superagent'); var conf = get_conf(); +var flags = {}; var subscriber = redis.createClient(conf.redis_socketio || conf.redis_async_broker_port); // serve socketio @@ -31,6 +32,14 @@ io.on('connection', function(socket){ return; } + if(flags[sid]) { + // throttle this function + return; + } + + flags[sid] = sid; + setTimeout(function() { flags[sid] = null; }, 10000); + socket.user = cookie.parse(socket.request.headers.cookie).user_id; // console.log("firing get_user_info");