Add pagination to /largetransactions, fix redundant condition in getBridgeVolume, add DB health check#490
Open
adityamane765 wants to merge 1 commit into
Conversation
…ridgeVolume, add DB health check
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.
DB connectivity check in /healthcheck
The healthcheck only reported CPU and memory status, meaning a dead DB connection would return 200 OK. Added a lightweight SELECT 1 ping with latency measurement. The response now includes a db field with status and latencyMs. Returns 503 if the DB is unreachable.
Pagination for /largetransactions/:chain
The endpoint previously returned up to 2000 rows with a hard cap and no way to page through results. Added ?limit (default 100, max 2000) and ?offset query parameters. The response now includes total, limit, and offset fields alongside the transactions array so clients can page through large datasets.
Fix redundant condition in getBridgeVolume
Removed a duplicate nested if (!bridgeNetwork) check that was identical to its outer condition. Behaviour is unchanged.