This commit is contained in:
Philipinho
2026-04-22 12:58:19 +01:00
parent 68309247b5
commit cbf03fc956
13 changed files with 911 additions and 1 deletions
@@ -18,6 +18,7 @@ export interface ConfluenceApiImports {
warnings: Generated<Json>;
currentPhase: string | null;
cancelled: Generated<boolean>;
spaceKeys: Generated<Json>;
workspaceId: string;
creatorId: string | null;
createdAt: Generated<Timestamp>;
@@ -28,6 +28,9 @@ export class FileTaskProcessor extends WorkerHost implements OnModuleDestroy {
case QueueJob.IMPORT_TASK:
await this.fileTaskService.processZIpImport(job.data.fileTaskId);
break;
case QueueJob.CONFLUENCE_API_IMPORT:
await this.processConfluenceApiImport(job.data.fileTaskId);
break;
case QueueJob.PDF_EXPORT_TASK:
await this.processExportTask(job.data.fileTaskId);
break;
@@ -49,6 +52,19 @@ export class FileTaskProcessor extends WorkerHost implements OnModuleDestroy {
});
}
private getConfluenceApiImportService() {
// eslint-disable-next-line @typescript-eslint/no-require-imports
const mod = require('./../../../ee/confluence-api-import/confluence-api-import.service');
return this.moduleRef.get(mod.ConfluenceApiImportService, {
strict: false,
});
}
private async processConfluenceApiImport(fileTaskId: string): Promise<void> {
const service = this.getConfluenceApiImportService();
await service.processImport(fileTaskId);
}
private async processExportTask(fileTaskId: string): Promise<void> {
const pdfExportService = this.getPdfExportService();
await pdfExportService.generateAndStorePdf(fileTaskId);
@@ -74,6 +90,8 @@ export class FileTaskProcessor extends WorkerHost implements OnModuleDestroy {
await this.handleFailedImportJob(job);
} else if (job.name === QueueJob.PDF_EXPORT_TASK) {
await this.handleFailedExportJob(job);
} else if (job.name === QueueJob.CONFLUENCE_API_IMPORT) {
await this.handleFailedExportJob(job);
}
}
@@ -30,6 +30,7 @@ export enum QueueJob {
FIRST_PAYMENT_EMAIL = 'first-payment-email',
IMPORT_TASK = 'import-task',
CONFLUENCE_API_IMPORT = 'confluence-api-import-task',
EXPORT_TASK = 'export-task',
SEARCH_INDEX_PAGE = 'search-index-page',