Skip to content

Commit

Permalink
chore(env): add env vars for data verification workout count and stre…
Browse files Browse the repository at this point in the history
…am timeout

These give us flexiblity when setting up integration tests. Not exposing them on docker-compose as data verification is not enabled by default.
  • Loading branch information
dtfiedler committed Jan 24, 2025
1 parent fa00d38 commit cdf770d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ export const BACKGROUND_DATA_VERIFICATION_WORKER_COUNT = +env.varOrDefault(
'1',
);

export const BACKGROUND_DATA_VERIFICATION_STREAM_TIMEOUT_MS = +env.varOrDefault(
'BACKGROUND_DATA_VERIFICATION_STREAM_TIMEOUT_MS',
'1000 * 30', // 30 seconds
);

//
// GraphQL
//
Expand Down
7 changes: 2 additions & 5 deletions src/workers/data-verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ import { ContiguousDataIndex, ContiguousDataSource } from '../types.js';
import { DataRootComputer } from '../lib/data-root.js';
import * as config from '../config.js';

const DEFAULT_STREAM_TIMEOUT = 1000 * 30; // 30 seconds
const DEFAULT_WORKER_COUNT = 1;

export class DataVerificationWorker {
// Dependencies
private log: winston.Logger;
Expand All @@ -41,8 +38,8 @@ export class DataVerificationWorker {
log,
contiguousDataIndex,
contiguousDataSource,
workerCount = DEFAULT_WORKER_COUNT,
streamTimeout = DEFAULT_STREAM_TIMEOUT,
workerCount = config.BACKGROUND_DATA_VERIFICATION_WORKER_COUNT,
streamTimeout = config.BACKGROUND_DATA_VERIFICATION_STREAM_TIMEOUT_MS,
interval = config.BACKGROUND_DATA_VERIFICATION_INTERVAL_SECONDS * 1000,
}: {
log: winston.Logger;
Expand Down
1 change: 0 additions & 1 deletion test/end-to-end/data-sources.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ describe('DataSources', () => {

localStack = await new LocalstackContainer('localstack/localstack:3')
.withNetwork(network as any)
.withName('localstack')
.start();

// Create a bucket
Expand Down

0 comments on commit cdf770d

Please sign in to comment.