Skip to content

Commit 9a58c20

Browse files
authored
fix: best effort for state db deletion (#661)
1 parent fb5f31b commit 9a58c20

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/uipath_langchain/runtime/factory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ def _get_connection_string(self) -> str:
7676
):
7777
# If not resuming and no job id, delete the previous state file
7878
if os.path.exists(path):
79-
os.remove(path)
79+
try:
80+
os.remove(path)
81+
except OSError:
82+
pass # File may be held by another process
8083
os.makedirs(self.context.runtime_dir, exist_ok=True)
8184
return path
8285

0 commit comments

Comments
 (0)