zulip/zerver
Umair Khan b4d49720b0 tornado: Close queue connection on reload.
Tornado reloads the app whenever there is a change in code. Due to this,
new connection is created to the client which also results in a new
channel. To avoid creating two channels for the queue in the RabbitMQ
broker we should close the old channel. Otherwise messages sent to the
queue will be distributed among these two channels in a round robin
scheme and we will end up losing one message since one of the channels
doesn't have an active consumer.

This commit closes the connection to the queue whenever Tornado reloads
the application using add_reload_hook().

Fixes #5824.
2017-07-21 11:19:26 -07:00
..
fixtures markdown.js: Move markdown.js test to bugdown-data.json. 2017-07-18 12:56:47 -07:00
lib tornado: Move setup_tornado_rabbitmq to application.py 2017-07-21 09:55:25 +05:00
management tornado: Move setup_tornado_rabbitmq to application.py 2017-07-21 09:55:25 +05:00
migrations mypy: Fix incorrect mypy annotation in migration. 2017-07-18 12:56:23 -07:00
outgoing_webhooks Outgoing Webhook System: Add usage of Interfaces in DoRestCall. 2017-06-28 11:11:21 -04:00
templatetags tidying: Combine multiple 'import typing' lines onto one line. 2017-07-16 16:43:21 -07:00
tests decorator: Remove redundant tests for api_key_only_webhook_view. 2017-07-20 10:30:03 -07:00
tornado tornado: Close queue connection on reload. 2017-07-21 11:19:26 -07:00
views views: Remove unused get_user_profile_by_email import from users. 2017-07-20 16:50:23 -07:00
webhooks webhooks/slack: Support unicode. 2017-07-20 10:30:03 -07:00
worker Embedded bots: Fix minor errors to make embedded bots/service run. 2017-07-20 10:22:52 -07:00
__init__.py caching: Add configuration class for post-migration cache flushing. 2016-10-27 23:26:34 -07:00
apps.py Add notifications on new logins to Zulip. 2017-03-25 16:50:52 -07:00
context_processors.py settings: Change all uses of ZULIP_ADMINISTRATOR to FromAddress.SUPPORT. 2017-07-05 15:33:01 -07:00
decorator.py decorator: Handle invalid JSON in api_key_only_webhook_view. 2017-07-19 10:42:35 -07:00
exceptions.py Annotate zerver.exceptions, zerver.filters, zerver.logging_handlers. 2016-06-04 22:51:18 -07:00
filters.py mypy: Added Dict, List and Set imports. 2017-03-04 14:33:44 -08:00
forms.py emails: Change reset password emails to use to_user_id. 2017-07-16 16:56:39 -07:00
logging_handlers.py logging_handlers: Fix tracebacks being emailed in subject lines. 2017-04-25 18:55:11 -07:00
middleware.py Django 1.11: MIDDLEWARE_CLASSES setting is deprecated. 2017-06-13 15:04:04 -07:00
models.py utils: Cast generate_random_token to str. 2017-07-17 23:18:47 -07:00
signals.py emails: Add to_user_id argument to send_email. 2017-07-16 16:56:39 -07:00
static_header.txt Update static_header.txt with new license information. 2016-08-13 00:37:21 -07:00
storage.py pep8: Add compliance with rule E261 to storage.py. 2017-05-07 23:21:50 -07:00