fix: do not load duckdb binary unless required (#1776)

* fix: do not load duckdb binary unless required

* chore: ignore buggy ts-unused-export line
This commit is contained in:
Matthew Little
2023-12-21 14:16:00 +01:00
committed by GitHub
parent 656b79eaf3
commit db859ae980
2 changed files with 2 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ import { MIGRATIONS_DIR } from '../../datastore/pg-store';
* *
* It also has functions to prepare and finalize the database for an event-replay. * It also has functions to prepare and finalize the database for an event-replay.
*/ */
// ts-unused-exports:disable-next-line
export class ReplayController { export class ReplayController {
private readonly db; private readonly db;
private readonly dataset; private readonly dataset;

View File

@@ -20,7 +20,6 @@ import { PgStore } from './datastore/pg-store';
import { PgWriteStore } from './datastore/pg-write-store'; import { PgWriteStore } from './datastore/pg-write-store';
import { registerMempoolPromStats } from './datastore/helpers'; import { registerMempoolPromStats } from './datastore/helpers';
import { logger } from './logger'; import { logger } from './logger';
import { ReplayController } from './event-replay/parquet-based/replay-controller';
import { import {
isProdEnv, isProdEnv,
numberToHex, numberToHex,
@@ -284,6 +283,7 @@ async function handleProgramArgs() {
args.options.force args.options.force
); );
} else if (args.operand === 'from-parquet-events') { } else if (args.operand === 'from-parquet-events') {
const { ReplayController } = await import('./event-replay/parquet-based/replay-controller');
const replay = await ReplayController.init(); const replay = await ReplayController.init();
await replay.prepare(); await replay.prepare();
await replay.do(); await replay.do();