-
Notifications
You must be signed in to change notification settings - Fork 36
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
base: master
Are you sure you want to change the base?
Conversation
janbuchar
commented
Jun 9, 2025
- closes Refactor client timeouts - parity with Python implemenation #685
- modelled after refactor: Rework client timeout apify-client-python#384
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.
+1 for extracting the consts somewhere, so we don't have those in multiple places
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 🤦 |
/** | ||
* 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> { |
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.
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.
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.
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.