~replaceafill/ubuntu/trusty/schooltool/2.8_custom-css

« back to all changes in this revision

Viewing changes to src/schooltool/task/config/worker_default.py

  • Committer: Gediminas Paulauskas
  • Date: 2014-04-11 22:10:31 UTC
  • mfrom: (1.1.32)
  • Revision ID: menesis@pov.lt-20140411221031-8nkk5s1ey58z7cor
Tags: 1:2.6.3-0ubuntu1
* New upstream release.
  - Celery 3 support (LP: #1276384)
  - Switch to CKEditor (LP: #485898)
  - Fixed exception dates format in calendar widget of recurring events (LP: #372889)
  - Fixed export of deleted timetables (LP: #1281335)
  - Fixed term/section navigation in a different school year (LP: #1281050)
* debian/copyright: update, remove calwidget

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import kombu
2
2
import os
3
3
 
4
 
# Celery 3
5
 
#CELERY_QUEUES = (
6
 
#    kombu.Queue('default', kombu.Exchange('default'), routing_key='default'),
7
 
#    kombu.Queue('import',  kombu.Exchange('zodb'),   routing_key='zodb.import'),
8
 
#    kombu.Queue('report', kombu.Exchange('zodb'),   routing_key='zodb.report'),
9
 
#)
 
4
try:
 
5
    import celery.app.abstract
 
6
    assert celery.app.abstract  # silence pyflakes
 
7
    CELERY3 = False
 
8
except:
 
9
    CELERY3 = True
10
10
 
11
 
# Celery 2:
12
 
CELERY_QUEUES = {
13
 
    "default": {
14
 
        "exchange": "default",
15
 
        "binding_key": "default",
16
 
        },
17
 
    "zodb.report": {
18
 
        "exchange": "default",
19
 
        "binding_key": "zodb.report",
20
 
        },
21
 
#    "zodb.import": {
22
 
#        "exchange": "default",
23
 
#        "binding_key": "zodb.import",
24
 
#        },
25
 
    }
 
11
if CELERY3:
 
12
    CELERY_QUEUES = (
 
13
        kombu.Queue('default', kombu.Exchange('default'), routing_key='default'),
 
14
    #    kombu.Queue('import',  kombu.Exchange('zodb'),   routing_key='zodb.import'),
 
15
        kombu.Queue('report', kombu.Exchange('zodb'),   routing_key='zodb.report'),
 
16
    )
 
17
else:
 
18
    CELERY_QUEUES = {
 
19
        "default": {
 
20
            "exchange": "default",
 
21
            "binding_key": "default",
 
22
            },
 
23
        "zodb.report": {
 
24
            "exchange": "default",
 
25
            "binding_key": "zodb.report",
 
26
            },
 
27
        "zodb.import": {
 
28
            "exchange": "default",
 
29
            "binding_key": "zodb.import",
 
30
            },
 
31
        }
26
32
 
27
33
CELERY_DEFAULT_QUEUE = 'default'
28
34
CELERY_DEFAULT_EXCHANGE_TYPE = 'direct'
29
35
CELERY_DEFAULT_ROUTING_KEY = 'default'
30
36
 
31
 
CELERY_RESULT_BACKEND = "redis"
32
 
CELERY_REDIS_HOST = str(os.environ.get('REDIS_HOST', "localhost"))
33
 
CELERY_REDIS_PORT = int(os.environ.get('REDIS_PORT', 7079))
34
 
CELERY_REDIS_DB = 1
 
37
_REDIS_HOST = str(os.environ.get('REDIS_HOST', "localhost"))
 
38
_REDIS_PORT = int(os.environ.get('REDIS_PORT', 7079))
 
39
_REDIS_DB = 1
 
40
 
 
41
if CELERY3:
 
42
    CELERY_RESULT_BACKEND = "redis://%s:%d/%d" % (
 
43
        _REDIS_HOST, _REDIS_PORT, _REDIS_DB)
 
44
else:
 
45
    CELERY_RESULT_BACKEND = "redis"
 
46
    CELERY_REDIS_HOST = _REDIS_HOST
 
47
    CELERY_REDIS_PORT = _REDIS_PORT
 
48
    CELERY_REDIS_DB = _REDIS_DB
35
49
 
36
50
_BROKER_REDIS_DB = 0
37
51
 
38
 
BROKER_URL = "redis://%s:%s/%d" % (
39
 
    CELERY_REDIS_HOST, CELERY_REDIS_PORT, _BROKER_REDIS_DB)
 
52
BROKER_URL = "redis://%s:%d/%d" % (
 
53
    _REDIS_HOST, _REDIS_PORT, _BROKER_REDIS_DB)
40
54
 
41
55
CELERY_ENABLE_UTC = True
42
56
 
47
61
 
48
62
CELERY_STORE_ERRORS_EVEN_IF_IGNORED = True
49
63
CELERY_SERIALIZER = 'json'
 
64
CELERY_ACCEPT_CONTENT = ['json', 'pickle']
50
65
 
51
66
SCHOOLTOOL_CONFIG = os.environ.get('SCHOOLTOOL_CONF')
52
67
SCHOOLTOOL_RETRY_DB_CONFLICTS = 3