web / lib/jobs/handlers/create-events-batch-job
lib/jobs/handlers/create-events-batch-job
Defines the job handler for creating events from imported data.
This single job streams all batches from an import file. For each row, it performs the following:
- Skips rows that have been identified as duplicates in the
analyze-duplicates-job. - Generates a unique ID for the event.
- Associates any available geocoding results with the event.
- Creates a new document in the
eventscollection.
The job updates the import job’s progress and handles errors for individual rows.
Once all batches are processed, it marks the import job as COMPLETED.
Variables
createEventsBatchJob
constcreateEventsBatchJob:object
Type Declaration
slug
slug:
"create-events"=JOB_TYPES.CREATE_EVENTS
handler()
handler: (
context) =>Promise<{ output: \{ totalBatches: number; eventsCreated: number; eventsSkipped: number; errors: number; }; }>
Parameters
context
Returns
Promise<{ output: \{ totalBatches: number; eventsCreated: number; eventsSkipped: number; errors: number; }; }>
Last updated on