mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Set the startup environment variables (#4322)
This commit is contained in:
parent
88b73d0e16
commit
c08056ea37
|
|
@ -2,6 +2,7 @@ import os
|
|||
import subprocess
|
||||
|
||||
from .celery_base import CeleryBaseService
|
||||
from django.conf import settings
|
||||
|
||||
__all__ = ['CeleryDefaultService']
|
||||
|
||||
|
|
@ -14,7 +15,13 @@ class CeleryDefaultService(CeleryBaseService):
|
|||
|
||||
def open_subprocess(self):
|
||||
env = os.environ.copy()
|
||||
env['LC_ALL'] = 'C.UTF-8'
|
||||
env['PYTHONOPTIMIZE'] = '1'
|
||||
env['ANSIBLE_FORCE_COLOR'] = 'True'
|
||||
env['PYTHONPATH'] = settings.APPS_DIR
|
||||
env['SERVER_NAME'] = 'celery'
|
||||
if os.getuid() == 0:
|
||||
env.setdefault('C_FORCE_ROOT', '1')
|
||||
kwargs = {
|
||||
'cwd': self.cwd,
|
||||
'stderr': self.log_file,
|
||||
|
|
|
|||
Loading…
Reference in New Issue