[FIX] problem when trying to launch 2 servers, one for normal requests and one for im

bzr revid: nicolas.vanhoren@openerp.com-20130110152026-21nf54bc79q4xw9q
This commit is contained in:
niv-openerp 2013-01-10 16:20:26 +01:00
parent 9ff052ceb4
commit 1211ee2ae5
2 changed files with 5 additions and 4 deletions

View File

@ -138,6 +138,10 @@ class ImportController(openerp.addons.web.http.Controller):
num += 1
Watcher.get_watcher(res["dbname"]).stop(req.session._uid, users_watch or [], POLL_TIMER)
@openerp.addons.web.http.jsonrequest
def activated(self, req):
return not not openerp.tools.config.options["gevent"]
class im_message(osv.osv):
_name = 'im.message'
@ -183,9 +187,6 @@ class im_message(osv.osv):
cr.commit()
return False
def activated(self, cr, uid, context=None):
return not not openerp.tools.config.options["gevent"]
class im_user(osv.osv):
_name = "im.user"

View File

@ -72,7 +72,7 @@ openerp.web_im = function(instance) {
var me = self.users_cache[instance.session.uid];
delete self.users_cache[instance.session.uid];
self.c_manager.set_me(me);
return new instance.web.Model("im.message").call("activated", [], {context: new instance.web.CompoundContext()}).then(function(activated) {
self.rpc("/im/activated", {}).then(function(activated) {
if (activated) {
self.activated = true;
self.poll();