##// END OF EJS Templates
feat(celery): set msgpack as default serializer and drop json_ext as it's actually slower
super-admin -
r5296:121552d9 default
parent child Browse files
Show More
@@ -40,7 +40,6 b' from celery import Celery'
40 from celery import signals
40 from celery import signals
41 from celery import Task
41 from celery import Task
42 from celery import exceptions # noqa
42 from celery import exceptions # noqa
43 from kombu.serialization import register
44
43
45 import rhodecode
44 import rhodecode
46
45
@@ -51,11 +50,6 b' from rhodecode.lib.pyramid_utils import '
51 from rhodecode.lib.utils2 import str2bool
50 from rhodecode.lib.utils2 import str2bool
52 from rhodecode.model import meta
51 from rhodecode.model import meta
53
52
54
55 register('json_ext', json.dumps, json.loads,
56 content_type='application/x-json-ext',
57 content_encoding='utf-8')
58
59 log = logging.getLogger('celery.rhodecode.loader')
53 log = logging.getLogger('celery.rhodecode.loader')
60
54
61
55
@@ -75,9 +69,10 b' base_celery_config = {'
75 'result_persistent': True,
69 'result_persistent': True,
76 'imports': imports,
70 'imports': imports,
77 'worker_max_tasks_per_child': 20,
71 'worker_max_tasks_per_child': 20,
78 'accept_content': ['json_ext', 'json'],
72 'task_serializer': 'msgpack',
79 'task_serializer': 'json_ext',
73 'accept_content': ['json', 'msgpack'],
80 'result_serializer': 'json_ext',
74 'result_serializer': 'msgpack',
75 'result_accept_content': ['json', 'msgpack'],
81 'worker_hijack_root_logger': False,
76 'worker_hijack_root_logger': False,
82 'broker_connection_retry_on_startup': True,
77 'broker_connection_retry_on_startup': True,
83 'database_table_names': {
78 'database_table_names': {
General Comments 0
You need to be logged in to leave comments. Login now