refactor: change dir permission.

This commit is contained in:
liqiang-fit2cloud 2025-08-08 18:39:43 +08:00
parent ce52ee3ca7
commit 154fd5e52b
2 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@ from maxkb.const import CONFIG, PROJECT_DIR, LOG_DIR
celery_data_dir = os.path.join(PROJECT_DIR, 'data', 'celery_task')
if not os.path.exists(celery_data_dir) or not os.path.isdir(celery_data_dir):
os.makedirs(celery_data_dir, 0o700, exist_ok=True)
os.chmod(os.path.dirname(celery_data_dir), 0o700)
# Celery using redis as broker
redis_celery_once_db = CONFIG.get("REDIS_DB")
redis_celery_db = CONFIG.get('REDIS_DB')

View File

@ -63,6 +63,7 @@ def get_file_name():
pylint_dir = os.path.join(PROJECT_DIR, 'data', 'pylint')
if not os.path.exists(pylint_dir):
os.makedirs(pylint_dir, 0o700, exist_ok=True)
os.chmod(os.path.dirname(pylint_dir), 0o700)
return os.path.join(pylint_dir, file_name)