Skip to content

fix: Use appropriate timeouts #704

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

fix: Use appropriate timeouts #704

wants to merge 4 commits into from

Conversation

janbuchar
Copy link
Contributor

@janbuchar janbuchar added the t-tooling Issues with this label are in the ownership of the tooling team. label Jun 9, 2025
@janbuchar janbuchar requested review from B4nan, barjin and Pijukatel June 9, 2025 15:41
@github-actions github-actions bot added this to the 116th sprint - Tooling team milestone Jun 9, 2025
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Jun 9, 2025
Copy link
Contributor

@barjin barjin left a comment

Choose a reason for hiding this comment

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

+1 for extracting the consts somewhere, so we don't have those in multiple places

@janbuchar
Copy link
Contributor Author

Sorry for the confusion around secs/millis - I changed my approach when working on this and stopped when the client_timeouts test started to pass 🤦

@janbuchar janbuchar requested review from B4nan and barjin June 10, 2025 10:49
/**
* Resource client.
* @private
*/
export class ResourceClient extends ApiClient {
protected async _get<T, R>(options: T = {} as T): Promise<R | undefined> {
protected async _get<T, R>(options: T = {} as T, timeoutSecs?: number): Promise<R | undefined> {
Copy link
Member

Choose a reason for hiding this comment

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

wouldnt it be cleaner if we keep everything in milliseconds here? its kinda low level, not really a public API where we would want to have the seconds for convenience.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ApifyClient and HttpClient already accept timeoutSecs, so I'm afraid that ship has sailed... But you have a good point that these methods are only used internally, so it would make the internals of the resource clients a bit more uniform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor client timeouts - parity with Python implemenation
3 participants