Skip to content

Commit

Permalink
Fix constant names
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdjere committed Jan 10, 2024
1 parent c5e1050 commit ebf4bd2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { DeleteByQueryResponse } from '@elastic/elasticsearch/lib/api/types';
import { ToolingLog } from '@kbn/tooling-log';

// Number of times to retry when conflicts occur
export const RetryForConflictsAttempts = 2;
const RETRY_ATTEMPTS = 2;

// Delay between retries when conflicts occur
export const RetryForConflictsDelay = 200;
const RETRY_DELAY = 200;

/*
* Retry an Elasticsearch deleteByQuery operation if it runs into 409 Conflicts,
Expand All @@ -22,8 +22,8 @@ export async function retryIfDeleteByQueryConflicts<T>(
logger: ToolingLog,
name: string,
operation: () => Promise<DeleteByQueryResponse>,
retries: number = RetryForConflictsAttempts,
retryDelay: number = RetryForConflictsDelay
retries: number = RETRY_ATTEMPTS,
retryDelay: number = RETRY_DELAY
): Promise<DeleteByQueryResponse> {
const operationResult = await operation();
if (!operationResult.failures || operationResult.failures?.length === 0) {
Expand Down

0 comments on commit ebf4bd2

Please sign in to comment.