Skip to content
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

MTG-1110 Add request timeout for PG DB query #371

Merged
merged 5 commits into from
Jan 17, 2025

Conversation

andrii-kl
Copy link
Contributor

  • Added configurable timeout for the PG database queries
  • Added environment variables to configure PG database timeouts

Copy link
Collaborator

@armyhaylenko armyhaylenko left a comment

Choose a reason for hiding this comment

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

LBTM, feel free to add suggested changes

Comment on lines +151 to +158
.map_err(|e| {
if e.to_string().contains("statement timeout") {
StorageError::QueryTimedOut
} else {
StorageError::Common(e.to_string())
}
})?;

Copy link
Collaborator

Choose a reason for hiding this comment

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

would be cool if we could statically type the error in IndexDbError, but if it's not possible then i'm ok with what written here and below

nft_ingester/src/init.rs Outdated Show resolved Hide resolved
- Added configurable timeout for the PG database queries
- Added environment variables to configure PG database timeouts
- change error code for Query Timed Out error
@andrii-kl andrii-kl force-pushed the feature/MTG-1110_add-request-time-out-for-pg-db-query branch from 8231c84 to 752fc40 Compare January 17, 2025 13:36
@andrii-kl andrii-kl merged commit d0fcbf6 into main Jan 17, 2025
2 checks passed
@andrii-kl andrii-kl deleted the feature/MTG-1110_add-request-time-out-for-pg-db-query branch January 17, 2025 13:58
@StanChe
Copy link
Contributor

StanChe commented Jan 19, 2025

currently we have

Error: SqlxError("error returned from database: unsupported startup parameter in options: statement_timeout")

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.

4 participants