Fish Trophy

Jean-Francois Desjeans Gauthier got a fish trophy!

HUE-8747 [editor] Add celery to Hue managed_entry

Review Request #13831 - Created April 15, 2019 and submitted

Jean-Francois Desjeans Gauthier
hue
master
HUE-8747
hue
jgauthier
commit bbadc137d80c577ff40eb507b9d4fea5736ee5b1
Author: jdesjean <jgauthier@cloudera.com>
Date:   Fri Apr 12 14:04:30 2019 -0700

    HUE-8747 [editor] Add celery to Hue managed_entry

:100644 100644 495f5fa501... 40f798255c... M	desktop/core/src/desktop/__init__.py
:000000 100644 0000000000... a69ef52a52... A	desktop/core/src/desktop/management/commands/runcelery.py


  1. Nice!

    And maybe we could add the auto-restart on file change option in a follow-up? (and by default when we are in dev/debug mode in the hue.ini)

    import shlex
    import subprocess

    from django.core.management.base import BaseCommand
    from django.utils import autoreload

    def restart_celery():
    print('Restarting celery worker because of autoreload...')
    cmd = 'pkill -9 -f "celery worker"'
    subprocess.call(shlex.split(cmd))

    cmd = 'celery worker -l info -A core --concurrency=2'
    subprocess.call(shlex.split(cmd))
    

    class Command(BaseCommand):

    def handle(self, *args, **options):
        print('Starting celery worker with autoreload...')
        autoreload.main(restart_celery)
    
  2. 
      
Review request changed

Status: Closed (submitted)

Loading...