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(go): explicit usage of browse helpers #3417

Merged
merged 2 commits into from
Jul 25, 2024
Merged

fix(go): explicit usage of browse helpers #3417

merged 2 commits into from
Jul 25, 2024

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Jul 25, 2024

🧭 What and Why

Don't silence the error on CreateIterable, add some doc, and make the usage more explicit by only returning error and force to use WithAggragator.

@millotp millotp self-assigned this Jul 25, 2024
@millotp millotp requested a review from a team as a code owner July 25, 2024 09:54
@millotp millotp requested review from morganleroi and shortcuts July 25, 2024 09:54
@algolia-bot
Copy link
Collaborator

algolia-bot commented Jul 25, 2024

✔️ Code generated!

Name Link
🪓 Triggered by ccc31913f7d3086f8471ae26a2f30b56b49f904a
🍃 Generated commit 60ca3b1c4c82a8c79c07cd1a060d3e974db7c9cf
🌲 Generated branch generated/fix/go-browse
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Rate
go 459

Copy link

github-actions bot commented Jul 25, 2024

Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

great catch!

Comment on lines +3 to +6
maxRetries: -1,
timeout: func(count int) time.Duration {
return 0 * time.Millisecond
},
Copy link
Member

Choose a reason for hiding this comment

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

is this expected to change defaults?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes it shouldn't wait by default, the function calling this should provide a default.
This was causing the browseObjects helper to wait 1s between each call for no reason

@@ -124,18 +111,18 @@ func (c *APIClient) WaitForTask(
// provide a defalut timeout function
opts = append([]IterableOption{WithTimeout(func(count int) time.Duration {
return time.Duration(min(200*count, 5000)) * time.Millisecond
})}, opts...)
}), WithMaxRetries(50)}, opts...)
Copy link
Member

Choose a reason for hiding this comment

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

ah ok it's here now

@millotp millotp enabled auto-merge (squash) July 25, 2024 13:18
@millotp millotp merged commit ed9e145 into main Jul 25, 2024
12 checks passed
@millotp millotp deleted the fix/go-browse branch July 25, 2024 13:19
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.

3 participants