From bf6c362a37aba7d4c45d9ee25b8ebfbc0369499b Mon Sep 17 00:00:00 2001 From: Kilian Schuettler Date: Wed, 3 Apr 2024 17:16:54 +0200 Subject: [PATCH] RED-7384: migration fixes * finalize migration again for "persistence-service-ready": true details --- .../v1/processor/migration/SaasMigrationService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/migration/SaasMigrationService.java b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/migration/SaasMigrationService.java index cc0339fdd..90d2e6321 100644 --- a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/migration/SaasMigrationService.java +++ b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/migration/SaasMigrationService.java @@ -113,6 +113,9 @@ public class SaasMigrationService implements TenantSyncService { } log.info("Added {} documents for tenant {} to Layout-Parsing queue for saas migration", numberOfFiles, TenantContext.getTenantId()); + if (numberOfFiles == 0) { + finalizeMigration(); + } } @@ -227,8 +230,7 @@ public class SaasMigrationService implements TenantSyncService { saasMigrationStatusPersistenceService.updateStatus(fileId, SaasMigrationStatus.FINISHED); log.info("AnnotationIds migration finished for saas migration for tenant {} dossier {} and file {}", TenantContext.getTenantId(), dossierId, fileId); -// finalizeMigration(); // AutomaticAnalysisJob should be re-enabled by re-starting the persistence service pod after a rule change -// This ensures no analysis will happen with outdated rules + finalizeMigration(); } @@ -297,7 +299,7 @@ public class SaasMigrationService implements TenantSyncService { private void finalizeMigration() { if (saasMigrationStatusPersistenceService.countByStatus(SaasMigrationStatus.FINISHED) == saasMigrationStatusPersistenceService.countAll()) { - automaticAnalysisJob.startForTenant(TenantContext.getTenantId()); +// automaticAnalysisJob.startForTenant(TenantContext.getTenantId()); // AutomaticAnalysisJob should be re-enabled by re-starting the persistence service pod after a rule change tenantProvider.updateDetails(TenantContext.getTenantId(), UpdateDetailsRequest.builder().key("persistence-service-ready").value(true).build()); log.info("Saas migration finished for tenantId {}, re-enabled scheduler", TenantContext.getTenantId()); }