Просмотр исходного кода

remove file accidentally added

Futa Arai 1 год назад
Родитель
Сommit
f8bc1c0b01

+ 0 - 38
apps/app/src/features/page-bulk-export/server/service/page-bulk-export/page-bulk-export-job-manager.ts

@@ -1,38 +0,0 @@
-import type { Readable } from 'stream';
-
-import type { ObjectIdLike } from '~/server/interfaces/mongoose-utils';
-
-import { BulkExportJobExpiredError, BulkExportJobRestartedError } from './errors';
-
-interface JobInProgress {
-  id: string;
-  stream: Readable | undefined;
-}
-
-class PageBulkExportJobManager {
-
-  jobsInProgress: JobInProgress[] = [];
-
-  updateJobStream(jobId: ObjectIdLike, stream: Readable): void {
-    const jobInProgress = this.jobsInProgress.find(job => job.id === jobId.toString());
-    if (jobInProgress != null) {
-      jobInProgress.stream = stream;
-    }
-  }
-
-  removeJobInProgress(jobId: ObjectIdLike, isJobRestarted = false): void {
-    const jobInProgress = this.jobsInProgress.find(job => job.id === jobId.toString());
-    if (jobInProgress == null) return;
-
-    if (jobInProgress.stream != null) {
-      if (isJobRestarted) {
-        jobInProgress.stream.destroy(new BulkExportJobRestartedError());
-      }
-      else {
-        jobInProgress.stream.destroy(new BulkExportJobExpiredError());
-      }
-    }
-    this.jobsInProgress = this.jobsInProgress.filter(job => job.id !== jobId);
-  }
-
-}