-
Notifications
You must be signed in to change notification settings - Fork 7
fix: configurable state file #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,9 +67,16 @@ def _setup_instrumentation(self, trace_manager: UiPathTraceManager | None) -> No | |
|
|
||
| def _get_storage_path(self) -> str: | ||
| """Get the storage path for workflow state.""" | ||
| if self.context.state_file_path is not None: | ||
| return self.context.state_file_path | ||
|
|
||
| if self.context.runtime_dir and self.context.state_file: | ||
| path = os.path.join(self.context.runtime_dir, self.context.state_file) | ||
| if not self.context.resume and self.context.job_id is None: | ||
| if ( | ||
| not self.context.resume | ||
| and self.context.job_id is None | ||
| and not self.context.keep_state_file | ||
| ): | ||
|
Comment on lines
+70
to
+79
|
||
| # If not resuming and no job id, delete the previous state file | ||
| if os.path.exists(path): | ||
| os.remove(path) | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
state_file_pathis provided by the user, the parent directory may not exist. Unlike the other code paths (lines 83 and 87), this branch doesn't callos.makedirsto ensure the directory exists before returning the path. This could lead to failures when SqliteResumableStorage tries to create the database file. Consider adding directory creation here to be consistent with other paths.