From 5c59a568b363f5c6b45e15136c2dc7741557e5b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Fri, 30 Aug 2024 11:09:09 +0200 Subject: [PATCH] fix(batch-exports): Correctly check for 5 minute bounds (#24694) --- .../src/scenes/pipeline/batchExportRunsLogic.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/scenes/pipeline/batchExportRunsLogic.tsx b/frontend/src/scenes/pipeline/batchExportRunsLogic.tsx index 3d5d8e3e67517..8687c7756338b 100644 --- a/frontend/src/scenes/pipeline/batchExportRunsLogic.tsx +++ b/frontend/src/scenes/pipeline/batchExportRunsLogic.tsx @@ -102,13 +102,15 @@ export const batchExportRunsLogic = kea([ end_at: !end_at ? 'End date is required' : undefined, }), submit: async ({ start_at, end_at }) => { - if (values.batchExportConfig && values.batchExportConfig.interval.endsWith('minutes')) { + if ( + values.batchExportConfig && + values.batchExportConfig.interval.endsWith('minutes') && + start_at?.minute() !== undefined && + end_at?.minute() !== undefined + ) { // TODO: Make this generic for all minute frequencies. // Currently, only 5 minute batch exports are supported. - if ( - !(start_at?.minute() && start_at?.minute() % 5 === 0) || - !(end_at?.minute() && end_at?.minute() % 5 === 0) - ) { + if (!(start_at?.minute() % 5 === 0) || !(end_at?.minute() % 5 === 0)) { lemonToast.error( 'Backfilling a 5 minute batch export requires bounds be multiple of five minutes' )