-
Notifications
You must be signed in to change notification settings - Fork 4
Use @fastify/fastify-postgres. CheckerNetwork/roadmap#220 #341
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
31a5f9b
6206573
51bfcad
3717210
973b0da
826d075
e89a63c
26d73c7
2608fdc
c0a95b2
6a76461
f6a0319
59448e4
9423683
97ac2bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ import { | |
migrateEvaluateDB, | ||
migrateStatsDB | ||
} from '@filecoin-station/spark-stats-db' | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please undo this change to keep the diff clean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, noted |
||
const pgPools = await getPgPools() | ||
await migrateStatsDB(pgPools.stats) | ||
await migrateEvaluateDB(pgPools.evaluate) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -440,11 +440,11 @@ export const fetchDailyClientRSRSummary = async (pg, { from, to }, clientId) => | |||||
|
||||||
/** | ||||||
* Fetches the retrieval stats summary for all allocators for given date range. | ||||||
* @param {PgPools} pgPools | ||||||
* @param {FastifyPg} pg - Fastify pg object with database connections | ||||||
* @param {import('./typings.js').DateRangeFilter} filter | ||||||
*/ | ||||||
export const fetchAllocatorsRSRSummary = async (pgPools, filter) => { | ||||||
const { rows } = await pgPools.evaluate.query(` | ||||||
export const fetchAllocatorsRSRSummary = async (pg, filter) => { | ||||||
const { rows } = await pg.evaluate.query(` | ||||||
SELECT | ||||||
allocator_id, | ||||||
SUM(total) as total, | ||||||
|
@@ -472,12 +472,12 @@ export const fetchAllocatorsRSRSummary = async (pgPools, filter) => { | |||||
|
||||||
/** | ||||||
* Fetches the retrieval stats summary for a single allocator for given date range. | ||||||
* @param {PgPools} pgPools | ||||||
* @param {FastifyPg} pg - Fastify pg object with database connections | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we keep the name
Suggested change
Same comment applies to all other similar places too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, noted |
||||||
* @param {import('./typings.js').DateRangeFilter} filter | ||||||
* @param {string} allocatorId | ||||||
*/ | ||||||
export const fetchDailyAllocatorRSRSummary = async (pgPools, { from, to }, allocatorId) => { | ||||||
const { rows } = await pgPools.evaluate.query(` | ||||||
export const fetchDailyAllocatorRSRSummary = async (pg, { from, to }, allocatorId) => { | ||||||
const { rows } = await pg.evaluate.query(` | ||||||
SELECT | ||||||
day::TEXT, | ||||||
SUM(total) as total, SUM(successful) as successful, | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.