Skip to content
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

Fix GetWorkflow to provide latest run id if none was provided to it #294

Merged
merged 4 commits into from
Nov 24, 2020

Conversation

Sushisource
Copy link
Member

Resolves #272

I'm not totally sure this is the way we want to go about this, though, so would very much appreciate feedback on the approach. I left some detail in a comment.

// and extract run id from there. This is definitely less efficient than it could be if there was a more specific
// rpc method for this, or if there were more granular history filters - in which case it could be extracted from
// the `iterFn` inside of `workflowRunImpl`
if runID == "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this code into workflowRunImpl.GetRunID to save the roundtrip for cases when runID is not being accessed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, initially I had tried doing this with the history iterator, but found the events wouldn't contain what I needed. I'll plumb in a way to access the client from inside GetRunID -- or perhaps make runID be lazily loaded.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made this lazy-load.

@Sushisource Sushisource merged commit 569d0d4 into temporalio:master Nov 24, 2020
@Sushisource Sushisource deleted the sj-fix-272 branch November 24, 2020 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get RunId using WorkflowClient
2 participants