MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / get_task_log_path

Function get_task_log_path

apps/ops/celery/utils.py:41–51  ·  view source on GitHub ↗
(base_path, task_id, level=2)

Source from the content-addressed store, hash-verified

39
40
41def get_task_log_path(base_path, task_id, level=2):
42 task_id = str(task_id)
43 try:
44 uuid.UUID(task_id)
45 except:
46 return os.path.join(PROJECT_DIR, 'data', 'caution.txt')
47
48 rel_path = os.path.join(*task_id[:level], task_id + '.log')
49 path = os.path.join(base_path, rel_path)
50 make_dirs(os.path.dirname(path), exist_ok=True)
51 return path
52
53
54def get_celery_task_log_path(task_id):

Callers 1

get_celery_task_log_pathFunction · 0.85

Calls 1

make_dirsFunction · 0.85

Tested by

no test coverage detected