Skip to content

Commit

Permalink
Dont db insert on review app
Browse files Browse the repository at this point in the history
  • Loading branch information
mbthiery committed Aug 29, 2024
1 parent 977ae5e commit bc26c43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/app/stats/utils/fetchGovernanceMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,8 @@ const DEV_STATS: PositionMetricsByGroup = {
},
},
}

// HEROKU_PR_NUMBER injected to env vars when review app.
const SHOW_DEV_STATS =
process.env.NODE_ENV === "development" || !!process.env.HEROKU_PR_NUMBER

const getHntGovernanceMetrics = async () => {
if (SHOW_DEV_STATS) {
if (process.env.NODE_ENV === "development") {
return DEV_STATS
}

Expand All @@ -98,7 +93,7 @@ const getHntGovernanceMetrics = async () => {
export const fetchHntGovernanceStats = cache(getHntGovernanceMetrics)

const getSubDaoGovernanceMetrics = async (subDao: SubDao) => {
if (SHOW_DEV_STATS) {
if (process.env.NODE_ENV === "development") {
return DEV_STATS[subDao]
}

Expand Down
3 changes: 3 additions & 0 deletions src/knex/supplyLimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export class SupplyLimit {
const hasBurnIncrease =
record.hnt_burned > (latestBurn?.hnt_burned || BigInt(0))

// HEROKU_PR_NUMBER injected to env vars when review app.
if (!!process.env.HEROKU_PR_NUMBER) return latest || latestBurn || record

if (
// first time app is run
(!latest && !latestBurn) ||
Expand Down

0 comments on commit bc26c43

Please sign in to comment.