Skip to content

Commit

Permalink
fix: check for prod correctly when refreshing materialized views (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Jun 28, 2023
1 parent 52ae850 commit 4518043
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/pg/pg-store.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { Order, OrderBy } from '../api/schemas';
import { normalizedHexString, parseSatPoint } from '../api/util/helpers';
import { isProdEnv, normalizedHexString, parseSatPoint } from '../api/util/helpers';
import { OrdinalSatoshi, SatoshiRarity } from '../api/util/ordinal-satoshi';
import {
ChainhookPayload,
CursedInscriptionRevealed,
InscriptionRevealed,
} from '../chainhook/schemas';
import { ChainhookPayload } from '../chainhook/schemas';
import { ENV } from '../env';
import { logger } from '../logger';
import { getIndexResultCountType, inscriptionContentToJson } from './helpers';
Expand Down Expand Up @@ -531,9 +527,8 @@ export class PgStore extends BasePgStore {
}

async refreshMaterializedView(viewName: string) {
const isProd = process.env.NODE_ENV === 'production';
await this.sql`REFRESH MATERIALIZED VIEW ${
isProd ? this.sql`CONCURRENTLY` : this.sql``
isProdEnv ? this.sql`CONCURRENTLY` : this.sql``
} ${this.sql(viewName)}`;
}

Expand Down

0 comments on commit 4518043

Please sign in to comment.