fix: 修复dev 无法启动celery
This commit is contained in:
parent
2a87af6172
commit
d315c01133
@ -26,7 +26,7 @@ class Command(BaseCommand):
|
|||||||
service = options.get('service')
|
service = options.get('service')
|
||||||
os.environ.setdefault('CELERY_NAME', ','.join(service))
|
os.environ.setdefault('CELERY_NAME', ','.join(service))
|
||||||
server_hostname = os.environ.get("SERVER_HOSTNAME")
|
server_hostname = os.environ.get("SERVER_HOSTNAME")
|
||||||
if os.getuid() == 0:
|
if hasattr(os, 'getuid') and os.getuid() == 0:
|
||||||
os.environ.setdefault('C_FORCE_ROOT', '1')
|
os.environ.setdefault('C_FORCE_ROOT', '1')
|
||||||
if not server_hostname:
|
if not server_hostname:
|
||||||
server_hostname = '%h'
|
server_hostname = '%h'
|
||||||
|
|||||||
@ -91,7 +91,7 @@ LOGGING = {
|
|||||||
},
|
},
|
||||||
'sqlalchemy': {
|
'sqlalchemy': {
|
||||||
'handlers': ['console', 'file', 'syslog'],
|
'handlers': ['console', 'file', 'syslog'],
|
||||||
'level': LOG_LEVEL,
|
'level': "ERROR",
|
||||||
'propagate': False,
|
'propagate': False,
|
||||||
},
|
},
|
||||||
'django.db.backends': {
|
'django.db.backends': {
|
||||||
@ -119,9 +119,6 @@ LOGGING = {
|
|||||||
'level': "DEBUG",
|
'level': "DEBUG",
|
||||||
'propagate': False,
|
'propagate': False,
|
||||||
},
|
},
|
||||||
'sqlalchemy': {'handlers': ['console', 'file'],
|
|
||||||
'level': "ERROR",
|
|
||||||
'propagate': False, }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user