Skip to content

Commit

Permalink
[#2977] Mark Celery features as deprecated.
Browse files Browse the repository at this point in the history
  • Loading branch information
torfsen committed Sep 12, 2016
1 parent 4f50fe3 commit dd2edc3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ckan/lib/celery_app.py
@@ -1,5 +1,11 @@
# encoding: utf-8

'''
Celery background tasks management.
This module is DEPRECATED, use ``ckan.lib.jobs`` instead.
'''

import ConfigParser
import os
import logging
Expand All @@ -9,6 +15,8 @@

log = logging.getLogger(__name__)

log.warning('ckan.lib.celery_app is deprecated, use ckan.lib.jobs instead.')

LIST_PARAMS = """CELERY_IMPORTS ADMINS ROUTES""".split()

from celery import Celery
Expand Down
5 changes: 5 additions & 0 deletions ckan/lib/cli.py
Expand Up @@ -946,6 +946,8 @@ def purge(self, dataset_ref):
class Celery(CkanCommand):
'''Celery daemon
This command is DEPRECATED, use `paster jobs` instead.
Usage:
celeryd <run> - run the celery daemon
celeryd run concurrency - run the celery daemon with
Expand Down Expand Up @@ -973,6 +975,7 @@ def command(self):
error('Command %s not recognized' % cmd)

def run_(self):
deprecation_warning(u'Use `paster jobs worker` instead.')
default_ini = os.path.join(os.getcwd(), 'development.ini')

if self.options.config:
Expand All @@ -989,6 +992,7 @@ def run_(self):
celery.worker_main(argv=['celeryd', '--loglevel=INFO'] + celery_args)

def view(self):
deprecation_warning(u'Use `paster jobs list` instead.')
self._load_config()
import ckan.model as model
from kombu.transport.sqlalchemy.models import Message
Expand All @@ -1003,6 +1007,7 @@ def view(self):
print '%i: Invisible Sent:%s' % (message.id, message.sent_at)

def clean(self):
deprecation_warning(u'Use `paster jobs clear` instead.')
self._load_config()
import ckan.model as model
query = model.Session.execute("select * from kombu_message")
Expand Down
2 changes: 2 additions & 0 deletions ckan/logic/action/get.py
Expand Up @@ -1114,6 +1114,8 @@ def resource_view_list(context, data_dict):
def resource_status_show(context, data_dict):
'''Return the statuses of a resource's tasks.
This function is DEPRECATED.
:param id: the id of the resource
:type id: string
Expand Down

0 comments on commit dd2edc3

Please sign in to comment.