Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.
TypeScript cloud-alternativecollaborationcollaborative-editingdropboxfile-serverfile-sharingfile-storagefile-syncfull-text-searchhomelabnextcloudon-premiseopen-sourceprivacy-firstprivate-cloudrealtimesecureself-hostedstorage-serverwebdav
fix(backend:files): ensure content indexing scheduling has no parallel executions
johaven0bef5a6799e7
diff --git a/.gitignore b/.gitignoreindex 0b077ab4..39fe4586 100755--- a/.gitignore+++ b/.gitignore@@ -15,4 +15,5 @@ frontend/tmpfrontend/out-tscfrontend/bazel-out/frontend/src/assets/pdfjs/-circular-dependencies.png\ No newline at end of file+circular-dependencies.png!+backend/src/applications/files/assets/ocr-languages/*.traineddata\ No newline at end of filediff --git a/backend/src/applications/files/assets/ocr-languages/.gitkeep b/backend/src/applications/files/assets/ocr-languages/.gitkeepnew file mode 100644index 00000000..8b137891--- /dev/null+++ b/backend/src/applications/files/assets/ocr-languages/.gitkeep@@ -0,0 +1 @@+diff --git a/backend/src/applications/files/services/files-scheduler.service.ts b/backend/src/applications/files/services/files-scheduler.service.tsindex 6ab0b556..80f46428 100644--- a/backend/src/applications/files/services/files-scheduler.service.ts+++ b/backend/src/applications/files/services/files-scheduler.service.ts@@ -23,6 +23,7 @@ import { FilesTasksManager } from './files-tasks-manager.service'@Injectable()export class FilesScheduler {private readonly logger = new Logger(FilesScheduler.name)+ private isIndexContentFilesRunning = falseconstructor(@Inject(DB_TOKEN_PROVIDER) private readonly db: DBSchema,@@ -134,10 +135,19 @@ export class FilesScheduler {@Cron(CronExpression.EVERY_4_HOURS)async indexContentFiles(): Promise<void> {// Conditional loading of file content indexing- if (!configuration.applications.files.contentIndexing) return+ if (!configuration.applications.files.contentIndexing.enabled) return+ if (this.isIndexContentFilesRunning) {+ this.logger.warn({ tag: this.indexContentFiles.name, msg: `SKIP (already running)` })+ return+ }+ this.isIndexContentFilesRunning = truethis.logger.log({ tag: this.indexContentFiles.name, msg: `START` })- await this.filesContentManager.parseAndIndexAllFiles()- this.logger.log({ tag: this.indexContentFiles.name, msg: `END` })+ try {+ await this.filesContentManager.parseAndIndexAllFiles()+ this.logger.log({ tag: this.indexContentFiles.name, msg: `END` })+ } finally {+ this.isIndexContentFilesRunning = false+ }}@Cron(CronExpression.EVERY_DAY_AT_4AM)