Skip to content

Add pagination to /largetransactions, fix redundant condition in getBridgeVolume, add DB health check#490

Open
adityamane765 wants to merge 1 commit into
DefiLlama:masterfrom
adityamane765:feat/pagination-and-healthcheck
Open

Add pagination to /largetransactions, fix redundant condition in getBridgeVolume, add DB health check#490
adityamane765 wants to merge 1 commit into
DefiLlama:masterfrom
adityamane765:feat/pagination-and-healthcheck

Conversation

@adityamane765
Copy link
Copy Markdown
Contributor

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.

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.

1 participant