Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/event_processor/batch_event_processor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import { expect, describe, it, vi, beforeEach, afterEach, MockInstance } from 'vitest';

import { EventWithId, BatchEventProcessor, LOGGER_NAME } from './batch_event_processor';
import { EventWithId, BatchEventProcessor, LOGGER_NAME, DEFAULT_MIN_BACKOFF, DEFAULT_MAX_BACKOFF } from './batch_event_processor';
import { getMockAsyncCache, getMockSyncCache } from '../tests/mock/mock_cache';
import { createImpressionEvent } from '../tests/mock/create_event';
import { ProcessableEvent } from './event_processor';
Expand Down Expand Up @@ -52,6 +52,11 @@ describe('BatchEventProcessor', async () => {
vi.useRealTimers();
});

it('should have correct default retry backoff constants', () => {
expect(DEFAULT_MIN_BACKOFF).toBe(200);
expect(DEFAULT_MAX_BACKOFF).toBe(3000);
});

it('should set name on the logger passed into the constructor', () => {
const logger = getMockLogger();

Expand Down
2 changes: 1 addition & 1 deletion lib/event_processor/batch_event_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { SERVICE_STOPPED_BEFORE_RUNNING } from "../service";
import { Platform } from '../platform_support';

export const DEFAULT_MIN_BACKOFF = 200;
export const DEFAULT_MAX_BACKOFF = 1000;
export const DEFAULT_MAX_BACKOFF = 3000;
export const MAX_EVENTS_IN_STORE = 500;

export type EventWithId = {
Expand Down
Loading