# ParsingQueue

**Kind:** Class

**Source:** [`atloria-monorepo/apps/api/src/parsing/parsing.queue.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/api/src/parsing/parsing.queue.ts#L30)

**Implements:** `OnModuleInit`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `onModuleInit` | `onModuleInit()` | `void` |
| `addParseJob` | `addParseJob(data: ParseJobData)` | `Promise<{ id: string }>` |
| `getJobStatus` | `getJobStatus(jobId: string)` | `Promise<any>` |
| `cancelJob` | `cancelJob(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)
