Show More
@@ -76,8 +76,9 b' class RhodecodeCeleryTask(Task):' | |||
|
76 | 76 | |
|
77 | 77 | request = get_current_request() |
|
78 | 78 | |
|
79 | # we hook into kwargs since it is the only way to pass our data to the | |
|
80 | # celery worker in celery 2.2 | |
|
79 | if request: | |
|
80 | # we hook into kwargs since it is the only way to pass our data to | |
|
81 | # the celery worker in celery 2.2 | |
|
81 | 82 | kwargs.update({ |
|
82 | 83 | '_rhodecode_proxy_data': { |
|
83 | 84 | 'environ': { |
@@ -18,15 +18,16 b'' | |||
|
18 | 18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | import rhodecode | |
|
22 | from pylons import config | |
|
23 | ||
|
21 | 24 | from celery.loaders.base import BaseLoader |
|
22 | from pylons import config | |
|
23 | 25 | |
|
24 | 26 | to_pylons = lambda x: x.replace('_', '.').lower() |
|
25 | 27 | to_celery = lambda x: x.replace('.', '_').upper() |
|
26 | 28 | |
|
27 | 29 | LIST_PARAMS = """CELERY_IMPORTS ADMINS ROUTES""".split() |
|
28 | 30 | |
|
29 | ||
|
30 | 31 | class PylonsSettingsProxy(object): |
|
31 | 32 | """Pylons Settings Proxy |
|
32 | 33 | |
@@ -36,7 +37,7 b' class PylonsSettingsProxy(object):' | |||
|
36 | 37 | def __getattr__(self, key): |
|
37 | 38 | pylons_key = to_pylons(key) |
|
38 | 39 | try: |
|
39 |
value = |
|
|
40 | value = rhodecode.PYRAMID_SETTINGS[pylons_key] | |
|
40 | 41 | if key in LIST_PARAMS:return value.split() |
|
41 | 42 | return self.type_converter(value) |
|
42 | 43 | except KeyError: |
@@ -56,7 +57,7 b' class PylonsSettingsProxy(object):' | |||
|
56 | 57 | |
|
57 | 58 | def __setattr__(self, key, value): |
|
58 | 59 | pylons_key = to_pylons(key) |
|
59 |
|
|
|
60 | rhodecode.PYRAMID_SETTINGS[pylons_key] = value | |
|
60 | 61 | |
|
61 | 62 | def __setitem__(self, key, value): |
|
62 | 63 | self.__setattr__(key, value) |
General Comments 0
You need to be logged in to leave comments.
Login now