Changeset - 0270c714fa17
[Not reviewed]
default
0 3 0
Mads Kiilerich (mads) - 5 years ago 2020-12-26 20:21:24
mads@kiilerich.com
Grafted from: 2ab64fd4367d
celery: drop traces of support for task_always_eager

It was broken - retrieval of results didn't work.

Also, task_always_eager still require a working celery.broker_url even though
it is unused. It is thus much better to just set use_celery=false .
3 files changed with 1 insertions and 6 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -257,27 +257,24 @@ use_celery = false
 
## Celery config settings from https://docs.celeryproject.org/en/4.4.0/userguide/configuration.html prefixed with 'celery.'.
 

	
 
## Example: use the message queue on the local virtual host 'kallitheavhost' as the RabbitMQ user 'kallithea':
 
celery.broker_url = amqp://kallithea:thepassword@localhost:5672/kallitheavhost
 

	
 
celery.result_backend = db+sqlite:///celery-results.db
 

	
 
#celery.amqp.task.result.expires = 18000
 

	
 
celery.worker_concurrency = 2
 
celery.worker_max_tasks_per_child = 100
 

	
 
## If true, tasks will never be sent to the queue, but executed locally instead.
 
celery.task_always_eager = false
 

	
 
####################################
 
##          BEAKER CACHE          ##
 
####################################
 

	
 
beaker.cache.data_dir = %(here)s/data/cache/data
 
beaker.cache.lock_dir = %(here)s/data/cache/lock
 

	
 
beaker.cache.regions = long_term,long_term_file
 

	
 
beaker.cache.long_term.type = memory
 
beaker.cache.long_term.expire = 36000
 
beaker.cache.long_term.key_length = 256
kallithea/lib/celery_app.py
Show inline comments
 
@@ -30,24 +30,25 @@ list_config_names = {'imports', 'accept_
 
desupported = set([
 
    'broker.url',
 
    'celery.accept.content',
 
    'celery.always.eager',
 
    'celery.amqp.task.result.expires',
 
    'celeryd.concurrency',
 
    'celeryd.max.tasks.per.child',
 
    'celery.result.backend',  # Note: the .ini template used this instead of 'celery.result_backend' in 0.6
 
    'celery.result.dburi',
 
    'celery.result.serialier',
 
    'celery.result.serializer',
 
    'celery.send.task.error.emails',
 
    'celery.task_always_eager',  # still a valid configuration in celery, but not supported in Kallithea
 
    'celery.task.serializer',
 
])
 

	
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
def make_celery_config(config):
 
    """Return Celery config object populated from relevant settings in a config dict, such as tg.config"""
 

	
 
    celery_config = CeleryConfig()
 

	
kallithea/templates/ini/template.ini.mako
Show inline comments
 
@@ -332,27 +332,24 @@ use_celery = false
 
<%text>##</%text> Celery config settings from https://docs.celeryproject.org/en/4.4.0/userguide/configuration.html prefixed with 'celery.'.
 

	
 
<%text>##</%text> Example: use the message queue on the local virtual host 'kallitheavhost' as the RabbitMQ user 'kallithea':
 
celery.broker_url = amqp://kallithea:thepassword@localhost:5672/kallitheavhost
 

	
 
celery.result_backend = db+sqlite:///celery-results.db
 

	
 
#celery.amqp.task.result.expires = 18000
 

	
 
celery.worker_concurrency = 2
 
celery.worker_max_tasks_per_child = 100
 

	
 
<%text>##</%text> If true, tasks will never be sent to the queue, but executed locally instead.
 
celery.task_always_eager = false
 

	
 
<%text>##</%text>##################################
 
<%text>##</%text>          BEAKER CACHE          ##
 
<%text>##</%text>##################################
 

	
 
beaker.cache.data_dir = %(here)s/data/cache/data
 
beaker.cache.lock_dir = %(here)s/data/cache/lock
 

	
 
beaker.cache.regions = long_term,long_term_file
 

	
 
beaker.cache.long_term.type = memory
 
beaker.cache.long_term.expire = 36000
 
beaker.cache.long_term.key_length = 256
0 comments (0 inline, 0 general)