From e92c9144737e3a6cdfa09e22af1b8900c34e6db4 Mon Sep 17 00:00:00 2001 From: mertmit Date: Sat, 10 Aug 2024 07:32:00 +0000 Subject: [PATCH] fix: avoid rerun if failed --- .../modules/jobs/migration-jobs/init-migration-jobs.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/modules/jobs/migration-jobs/init-migration-jobs.ts b/packages/nocodb/src/modules/jobs/migration-jobs/init-migration-jobs.ts index bd5d696633..e2befcd22c 100644 --- a/packages/nocodb/src/modules/jobs/migration-jobs/init-migration-jobs.ts +++ b/packages/nocodb/src/modules/jobs/migration-jobs/init-migration-jobs.ts @@ -120,8 +120,12 @@ export class InitMigrationJobs { // clear stall interval clearInterval(stallInterval); - // run the job again - await this.jobsService.add(MigrationJobTypes.InitMigrationJobs, {}); + // run the job again if successful + if (migrated) { + await this.jobsService.add(MigrationJobTypes.InitMigrationJobs, {}); + } else { + this.log('A migration job failed!'); + } } catch (e) { this.log('Error running migration: ', e); }