Skip to content

Conversation

@tharropoulos
Copy link
Collaborator

Change Summary

Add the ability to reconfigure retry parameters from a random integer between 60 and 120 seconds respectively to an arbitrary value.

PR Checklist

- introduces two new extension parameters:
  - `TYPESENSE_CONNECTION_TIMEOUT_SECONDS`
  - `TYPESENSE_RETRY_INTERVAL_SECONDS`
- updates `config.js` to parse values from environment variables
- replaces random timeout values with user-defined config in `createTypesenseClient.js`
- improves predictability and customizability of Typesense client behavior
- reintroduce random fallback values for connection and retry intervals
  when environment variables are missing or invalid
- modify `createTypesenseClient` to reuse fallback logic
- add test suite to verify default and random behavior for client config
- extend test script to include `typesenseClientDefaults.spec.js`
extension.yaml Outdated
The timeout in seconds for connections to Typesense. This applies to both connection timeout.
type: string
example: "60"
default: "60"
Copy link
Member

Choose a reason for hiding this comment

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

@tharropoulos The default in the UI is still set to 60, which will prevent the jitter from applying by default.

extension.yaml Outdated
The retry interval in seconds for connections to Typesense. This applies to both connection timeout.
type: string
example: "60"
default: "60"
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above.

@tharropoulos tharropoulos marked this pull request as ready for review August 4, 2025 10:00
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