Skip to content

Commit

Permalink
fix: remove getting updated import data at each step
Browse files Browse the repository at this point in the history
  • Loading branch information
tiago-freire committed Sep 4, 2024
1 parent c6eff7d commit 464d09f
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions node/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { AppSettingsInput } from 'ssesandbox04.catalog-importer'
import {
DEFAULT_BATCH_CONCURRENCY,
DEFAULT_VBASE_BUCKET,
IMPORT_EXECUTION_FULL_FIELDS,
IMPORT_STATUS,
MAX_RETRIES,
STEP_DELAY,
Expand Down Expand Up @@ -109,19 +108,6 @@ export const handleError = async (context: AppEventContext, e: ErrorLike) => {
export const processStepFactory = (context: AppEventContext) => async (
step: (context: AppEventContext) => Promise<void>
) => {
if (!context.state.body.id) return

const importData = await context.clients.importExecution.get(
context.state.body.id,
IMPORT_EXECUTION_FULL_FIELDS
)

const { settings, ...currentImport } = importData

if (importData.status !== IMPORT_STATUS.RUNNING) return

context.state.body = { ...context.state.body, ...currentImport }

if (context.state.body.error) return
await delay(STEP_DELAY)
context.state.entity = STEPS.find(({ handler }) => handler === step)?.entity
Expand Down

0 comments on commit 464d09f

Please sign in to comment.