Skip to content

Commit 34f4578

Browse files
committed
refactor(V2): promote poll interval to named constant
Extract the 3 000 ms commit-poll interval into a module-level COMMIT_POLL_INTERVAL_MS constant with a brief comment explaining the tradeoff, so future readers can find and tune it without grep-hunting for two matching magic numbers.
1 parent 31f8293 commit 34f4578

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/v2/live-api/helpers/live-api-helpers.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import {
1010
createRecoveryStuckTracker,
1111
} from './wallet-diagnostics.js';
1212

13+
// Reduced from 10 000 ms to cut idle wait time between blockchain commits.
14+
// Increases API call volume ~3x but stays well within the 30-minute suite timeout.
15+
const COMMIT_POLL_INTERVAL_MS = 3000;
16+
1317
/**
1418
* Format current timestamp as YYYY-MM-DD HH:mm:ss
1519
* @returns {string} - Formatted timestamp
@@ -595,7 +599,7 @@ export const checkOrganizationSynced = async (request) => {
595599
*/
596600
export const waitForPendingCommits = async (request, maxWaitTime = 600000) => {
597601
const startTime = Date.now();
598-
const interval = 3000;
602+
const interval = COMMIT_POLL_INTERVAL_MS;
599603
const timestamp = new Date().toISOString();
600604
const recoveryTracker = createRecoveryStuckTracker();
601605

@@ -633,7 +637,7 @@ export const waitForPendingCommits = async (request, maxWaitTime = 600000) => {
633637
*/
634638
export const waitForStagingEmpty = async (request, maxWaitTime = 600000) => {
635639
const startTime = Date.now();
636-
const interval = 3000;
640+
const interval = COMMIT_POLL_INTERVAL_MS;
637641
const recoveryTracker = createRecoveryStuckTracker();
638642

639643
console.log('Waiting for staging table to be empty...');

0 commit comments

Comments
 (0)