Skip to content

ParsingQueue

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/api/src/parsing/parsing.queue.ts

Implements: OnModuleInit

Methods

MethodSignatureReturns
onModuleInitonModuleInit()void
addParseJobaddParseJob(data: ParseJobData)Promise<{ id: string }>
getJobStatusgetJobStatus(jobId: string)Promise<any>
cancelJobcancelJob(jobId: string)Promise<boolean>

Where it refuses work

  • ParsingQueue stops the work with Error when !dbJob — “Job not found”.
  • ParsingQueue stops the work with Error when !cloneResult.success.
  • ParsingQueue stops the work with Error when !project || !project.organization.users[0] — “Project owner not found”.
  • ParsingQueue stops the work with an early return when !job.

When something fails

  • ParsingQueue handles failure in 4 places: it logs it and continues in 2, and lets it reach the caller in 2.

Referenced By

  • ParsingModule (MODULE_PROVIDES)
  • ParsingService (DEPENDS_ON)

Was this page helpful?

Download as PDF