Skip to content

Conversation

@eelkevdbos
Copy link
Contributor

Will make the api connector respect retry delay signalled by Twinfield via response headers.

Will make the api connector respect retry delay signalled by Twinfield via response headers.
@eelkevdbos eelkevdbos changed the title Add support for Retry-After header in BaseApiConnector. Add support for Retry-After header in BaseApiConnector Dec 2, 2025
@rojtjo
Copy link
Contributor

rojtjo commented Dec 4, 2025

Reading up on the rate limits I don't expect large retry-after values, but I don't feel comfortable enabling this by default as it might cause some timeout issues in some contexts (HTTP or queue for example).

Could you make this opt-in through ApiOptions?

@eelkevdbos
Copy link
Contributor Author

Reading up on the rate limits I don't expect large retry-after values, but I don't feel comfortable enabling this by default as it might cause some timeout issues in some contexts (HTTP or queue for example).

Could you make this opt-in through ApiOptions?

That is a valid concern. My current project is in CLI context, so I was a little naive with the implementation. Just for reference, when brute forcing the rate limit, I've seen header values around ~45s.

With respect to the opt-in implementation, the most robust option is probably to add an explicit option like bool $useRetryAfter = false or bool $useRetryAfterHeader = false. Do you have any preference in naming?

@rojtjo
Copy link
Contributor

rojtjo commented Dec 9, 2025

Sorry, somehow I didn't get a notification for this.

Either is fine with me.

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.

2 participants