Skip to content

Commit

Permalink
Use static stats for review apps
Browse files Browse the repository at this point in the history
  • Loading branch information
mbthiery committed Aug 29, 2024
1 parent b9e222f commit 977ae5e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/stats/utils/fetchGovernanceMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,13 @@ 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 (process.env.NODE_ENV === "development") {
if (SHOW_DEV_STATS) {
return DEV_STATS
}

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

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

Expand Down

0 comments on commit 977ae5e

Please sign in to comment.