You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
flyapps/fir_ser/api/management/commands/services/services/flower.py

39 lines
1003 B

from .base import BaseService
from ..hands import *
__all__ = ['FlowerService']
class FlowerService(BaseService):
def __init__(self, **kwargs):
super().__init__(**kwargs)
@property
def cmd(self):
print("\n- Start Flower as Task Monitor")
if os.getuid() == 0:
os.environ.setdefault('C_FORCE_ROOT', '1')
cmd = [
'celery', '-A',
'fir_ser', 'flower',
'-l', 'INFO',
'--url_prefix=/flower',
'--auto_refresh=False',
'--max_tasks=1000',
f'--address={CELERY_FLOWER_HOST}',
f'--port={CELERY_FLOWER_PORT}',
# '--basic_auth=flower:ninevenxxx'
# '--tasks_columns=uuid,name,args,state,received,started,runtime,worker'
]
if self.uid:
cmd.extend(['--uid', self.uid])
if self.gid:
cmd.extend(['--gid', self.gid])
return cmd
@property
def cwd(self):
return APPS_DIR