Merge remote-tracking branch 'origin/v3' into v3

pull/9125/head
feng 2022-11-27 12:57:31 +08:00
commit 7d0c480a13
5 changed files with 5 additions and 37 deletions

View File

@ -6,7 +6,6 @@ from .hands import *
class Services(TextChoices):
gunicorn = 'gunicorn', 'gunicorn'
daphne = 'daphne', 'daphne'
celery_ansible = 'celery_ansible', 'celery_ansible'
celery_default = 'celery_default', 'celery_default'
beat = 'beat', 'beat'
@ -22,7 +21,6 @@ class Services(TextChoices):
from . import services
services_map = {
cls.gunicorn.value: services.GunicornService,
cls.daphne: services.DaphneService,
cls.flower: services.FlowerService,
cls.celery_default: services.CeleryDefaultService,
cls.celery_ansible: services.CeleryAnsibleService,
@ -30,13 +28,9 @@ class Services(TextChoices):
}
return services_map.get(name)
@classmethod
def ws_services(cls):
return [cls.daphne]
@classmethod
def web_services(cls):
return [cls.gunicorn, cls.daphne, cls.flower]
return [cls.gunicorn, cls.flower]
@classmethod
def celery_services(cls):

View File

@ -1,6 +1,5 @@
from .beat import *
from .celery_ansible import *
from .celery_default import *
from .daphne import *
from .flower import *
from .gunicorn import *

View File

@ -1,25 +0,0 @@
from ..hands import *
from .base import BaseService
__all__ = ['DaphneService']
class DaphneService(BaseService):
def __init__(self, **kwargs):
super().__init__(**kwargs)
@property
def cmd(self):
print("\n- Start Daphne ASGI WS Server")
cmd = [
'daphne', 'jumpserver.asgi:application',
'-b', HTTP_HOST,
'-p', str(WS_PORT),
]
return cmd
@property
def cwd(self):
return APPS_DIR

View File

@ -17,9 +17,9 @@ class GunicornService(BaseService):
log_format = '%(h)s %(t)s %(L)ss "%(r)s" %(s)s %(b)s '
bind = f'{HTTP_HOST}:{HTTP_PORT}'
cmd = [
'gunicorn', 'jumpserver.wsgi',
'gunicorn', 'jumpserver.asgi:application',
'-b', bind,
'-k', 'gthread',
'-k', 'uvicorn.workers.UvicornWorker',
'--threads', '10',
'-w', str(self.worker),
'--max-requests', '4096',

View File

@ -86,8 +86,6 @@ pytz==2022.1
# Runtime
django-proxy==1.2.1
channels-redis==3.4.0
channels==3.0.4
daphne==3.0.2
python-daemon==2.3.0
eventlet==0.33.1
greenlet==1.1.2
@ -96,6 +94,8 @@ celery==5.2.7
flower==1.0.0
django-celery-beat==2.3.0
kombu==5.2.4
uvicorn==0.20.0
websockets==10.4
# Auth
python-ldap==3.4.0
ldap3==2.9.1