[Bug Fix] Fix FileExistsError when using Embedchain in multithreading setting (#1056)

This commit is contained in:
Deshraj Yadav
2023-12-24 16:33:53 +05:30
committed by GitHub
parent 68737da7a2
commit 6be29f5bed
4 changed files with 5 additions and 9 deletions

View File

@@ -39,9 +39,7 @@ class AnonymousTelemetry:
posthog_logger.disabled = True
def _get_user_id(self):
if not os.path.exists(CONFIG_DIR):
os.makedirs(CONFIG_DIR)
os.makedirs(CONFIG_DIR, exist_ok=True)
if os.path.exists(CONFIG_FILE):
with open(CONFIG_FILE, "r") as f:
data = json.load(f)