Files
odoo_source/addons/bus/controllers/main.py
T
tsm-odoo 5471bd4cb8 [IMP] mail: remove im status route
*: bus, hr_holidays.

The `/bus/im_status` route polls the server every minute in order for
the user im_status to be up to date. This commit removes this poll
by sending the im_status on the bus when updating the current user
presence.

Moreover, before [1], the user bus presence was updated on each poll.
When the user didn't poll for 50 seconds, we assumed the user was
disconnected. Since [1], the bus presence is updated each 30 seconds
by the `im_status` service. This is too frequent: there is no need
to update the user presence so often.

In order not to overhelm the server with unnecessary requests, the update
presence interval as well as the delay to be considered disconnected
have been updated: the former from 30 to 60 seconds, the later from
55 to 65 seconds (assuming that a user that has missed an update
presence tick is disconnected).

[1]: odoo/odoo@a5623d2

closes odoo/odoo#100249

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-20 11:33:51 +02:00

14 lines
481 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
from odoo.http import Controller, request, route
class BusController(Controller):
@route('/bus/get_model_definitions', methods=['POST'], type='http', auth='user')
def get_model_definitions(self, model_names_to_fetch, **kwargs):
return request.make_response(json.dumps(
request.env['ir.model']._get_model_definitions(json.loads(model_names_to_fetch)),
))