Skip to Content
⚠️Active Development Notice: TimeTiles is under active development. Information may be placeholder content or not up-to-date.

web


web / lib/jobs/workflows/review-checks

lib/jobs/workflows/review-checks

Review check functions for the ingest pipeline.

These checks run between pipeline tasks and can pause processing by setting the IngestJob to NEEDS_REVIEW with a specific reason. The user (or admin) reviews the issue and decides how to proceed.

Variables

REVIEW_REASONS

const REVIEW_REASONS: object

Review reasons — extensible enum for different pause conditions.

Type Declaration

SCHEMA_DRIFT

readonly SCHEMA_DRIFT: "schema-drift" = "schema-drift"

QUOTA_EXCEEDED

readonly QUOTA_EXCEEDED: "quota-exceeded" = "quota-exceeded"

HIGH_DUPLICATE_RATE

readonly HIGH_DUPLICATE_RATE: "high-duplicates" = "high-duplicates"

GEOCODING_PARTIAL

readonly GEOCODING_PARTIAL: "geocoding-partial" = "geocoding-partial"


REVIEW_RESUME_POINTS

const REVIEW_RESUME_POINTS: Record<string, string>

Maps review reason → resume point for the ingest-process workflow.

Functions

setNeedsReview()

setNeedsReview(payload, ingestJobId, reason, details): Promise<void>

Set an IngestJob to NEEDS_REVIEW with a specific reason and details.

Parameters

payload

BasePayload

ingestJobId

string | number

reason

string

details

Record<string, unknown>

Returns

Promise<void>


checkQuotaForSheet()

checkQuotaForSheet(payload, ingestJobId, uniqueRows): Promise<{ allowed: boolean; current?: number; limit?: number; estimatedNew?: number; reason?: string; }>

Check if importing uniqueRows events would exceed the user’s quota. Returns { allowed: true } or { allowed: false, ...details }.

Parameters

payload

BasePayload

ingestJobId

string | number

uniqueRows

number

Returns

Promise<{ allowed: boolean; current?: number; limit?: number; estimatedNew?: number; reason?: string; }>


shouldReviewHighDuplicates()

shouldReviewHighDuplicates(totalRows, uniqueRows): object

Check if the duplicate rate is too high (>80% by default). Returns true if review is needed.

Parameters

totalRows

number

uniqueRows

number

Returns

object

needsReview

needsReview: boolean

duplicateRate?

optional duplicateRate?: number


shouldReviewGeocodingPartial()

shouldReviewGeocodingPartial(geocoded, failed): object

Check if geocoding had too many failures (>50% by default). Returns true if review is needed.

Parameters

geocoded

number

failed

number

Returns

object

needsReview

needsReview: boolean

failRate?

optional failRate?: number


getResumePointForReason()

getResumePointForReason(reason): string

Get the resume point for a given review reason.

Parameters

reason

string | null | undefined

Returns

string

Last updated on