fix: make LinkedEvents API timeout configurable#455
Merged
Conversation
The hardcoded 20-second timeout was causing ReadTimeout errors when the external LinkedEvents API experienced high load or network latency. Changes: - Add LINKED_EVENTS_API_TIMEOUT env variable (default: 60s) - Read timeout from config in LinkedEventsApiClient - Remove hardcoded CONNECTION_TIMEOUT constant Resolves Sentry issue 89742127. Refs: PT-1992
Add tests for the configurable timeout feature: - Test timeout value is read from config - Test default timeout (60s) when not configured - Test all HTTP methods pass timeout to requests Refs: PT-1992
f371bf0 to
26992fc
Compare
|
|
KULTUS-API branch is deployed to platta: https://kultus-pr455.api.dev.hel.ninja 🚀🚀🚀 |
|
KULTUS-API branch is deployed to platta: https://kultus-pr455.api.dev.hel.ninja 🚀🚀🚀 |
voneiden
reviewed
Jan 22, 2026
voneiden
approved these changes
Jan 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Problem
The LinkedEvents API client had a hardcoded 20-second timeout that was
causing
ReadTimeouterrors when the external API experienced high loador network latency (Sentry issue 89742127).
Solution
LINKED_EVENTS_API_TIMEOUTenvironment variable (default: 60s)LinkedEventsApiClientinstead of usinga hardcoded class constant
Changes
palvelutarjotin/settings.pyLINKED_EVENTS_API_TIMEOUTenv variable definitionTIMEOUTkey toLINKED_EVENTS_API_CONFIGgraphene_linked_events/rest_client.pyCONNECTION_TIMEOUT = 20class variablegraphene_linked_events/tests/test_rest_client.pyConfiguration
Default is 60 seconds, can be adjusted per environment
LINKED_EVENTS_API_TIMEOUT=90References
Jira: PT-1992