Skip to content

Commit

Permalink
fix(batch-exports): Correctly check for 5 minute bounds (#24694)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias authored Aug 30, 2024
1 parent cbb7563 commit 5c59a56
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions frontend/src/scenes/pipeline/batchExportRunsLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ export const batchExportRunsLogic = kea<batchExportRunsLogicType>([
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'
)
Expand Down

0 comments on commit 5c59a56

Please sign in to comment.