fix: 修复dev 无法启动celery

This commit is contained in:
shaohuzhang1 2024-08-22 10:47:21 +08:00 committed by shaohuzhang1
parent 2a87af6172
commit d315c01133
2 changed files with 2 additions and 5 deletions

View File

@ -26,7 +26,7 @@ class Command(BaseCommand):
service = options.get('service')
os.environ.setdefault('CELERY_NAME', ','.join(service))
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')
if not server_hostname:
server_hostname = '%h'

View File

@ -91,7 +91,7 @@ LOGGING = {
},
'sqlalchemy': {
'handlers': ['console', 'file', 'syslog'],
'level': LOG_LEVEL,
'level': "ERROR",
'propagate': False,
},
'django.db.backends': {
@ -119,9 +119,6 @@ LOGGING = {
'level': "DEBUG",
'propagate': False,
},
'sqlalchemy': {'handlers': ['console', 'file'],
'level': "ERROR",
'propagate': False, }
}
}