##// END OF EJS Templates
celery: upgrade to Celery 5.0 ... and adjust for Click API...
Mads Kiilerich -
r8619:385d1b31 default
parent child Browse files
Show More
@@ -12,8 +12,8 b''
12 # You should have received a copy of the GNU General Public License
12 # You should have received a copy of the GNU General Public License
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14
14
15 import celery.bin.worker
16 import click
15 import click
16 from celery.bin.celery import celery as celery_command
17
17
18 import kallithea
18 import kallithea
19 import kallithea.bin.kallithea_cli_base as cli_base
19 import kallithea.bin.kallithea_cli_base as cli_base
@@ -42,5 +42,12 b' def celery_run(celery_args, config):'
42
42
43 kallithea.CELERY_APP.loader.on_worker_process_init = lambda: kallithea.config.application.make_app(config.global_conf, **config.local_conf)
43 kallithea.CELERY_APP.loader.on_worker_process_init = lambda: kallithea.config.application.make_app(config.global_conf, **config.local_conf)
44
44
45 cmd = celery.bin.worker.worker(kallithea.CELERY_APP)
45 args = list(celery_args)
46 return cmd.run_from_argv(None, command='celery-run -c CONFIG_FILE --', argv=list(celery_args))
46 # args[0] is generally ignored when prog_name is specified, but -h *needs* it to be 'worker' ... but will also suggest that users specify 'worker' explicitly
47 if not args or args[0] != 'worker':
48 args.insert(0, 'worker')
49
50 # inline kallithea.CELERY_APP.start in order to allow specifying prog_name
51 assert celery_command.params[0].name == 'app'
52 celery_command.params[0].default = kallithea.CELERY_APP
53 celery_command.main(args=args, prog_name='kallithea-cli celery-run -c CONFIG_FILE --')
@@ -55,7 +55,7 b' requirements = ['
55 "Mako >= 0.9.1, < 1.2",
55 "Mako >= 0.9.1, < 1.2",
56 "Pygments >= 2.2.0, < 2.7",
56 "Pygments >= 2.2.0, < 2.7",
57 "Whoosh >= 2.7.1, < 2.8",
57 "Whoosh >= 2.7.1, < 2.8",
58 "celery >= 4.3, < 4.5, != 4.4.4", # 4.4.4 is broken due to unexpressed dependency on 'future', see https://github.com/celery/celery/pull/6146
58 "celery >= 5, < 5.1",
59 "Babel >= 1.3, < 2.9",
59 "Babel >= 1.3, < 2.9",
60 "python-dateutil >= 2.1.0, < 2.9",
60 "python-dateutil >= 2.1.0, < 2.9",
61 "Markdown >= 2.2.1, < 3.2",
61 "Markdown >= 2.2.1, < 3.2",
General Comments 0
You need to be logged in to leave comments. Login now