diff --git a/front50-sql/src/main/kotlin/com/netflix/spinnaker/front50/migrations/StorageServiceMigrator.kt b/front50-sql/src/main/kotlin/com/netflix/spinnaker/front50/migrations/StorageServiceMigrator.kt index 748c86493..99cc07423 100644 --- a/front50-sql/src/main/kotlin/com/netflix/spinnaker/front50/migrations/StorageServiceMigrator.kt +++ b/front50-sql/src/main/kotlin/com/netflix/spinnaker/front50/migrations/StorageServiceMigrator.kt @@ -195,12 +195,21 @@ class StorageServiceMigrator( log.info("Migration complete in {}ms", migrationDurationMs) } -// @Scheduled(fixedDelay = 90000) -// fun migrateEntityTags() { -// val migrationDurationMs = measureTimeMillis { -// migrate(ObjectType.ENTITY_TAGS) -// } -// -// log.info("Entity Tags Migration complete in {}ms", migrationDurationMs) -// } + @Scheduled(fixedDelay = 90000) + fun migrateEntityTags() { + if (!dynamicConfigService.isEnabled("spinnaker.migration.entityTags", false)) { + log.info("Entity Tags Migrator has been disabled") + return + } + + val migrationDurationMs = measureTimeMillis { + try { + migrate(ObjectType.ENTITY_TAGS) + } catch (e: Exception) { + log.info("Entity Tags Migration failed", e) + } + } + + log.info("Entity Tags Migration complete in {}ms", migrationDurationMs) + } }