diff --git a/processors/db-processor/src/main/kotlin/net/corda/processors/db/internal/schedule/DeduplicationTableCleanUpProcessor.kt b/processors/db-processor/src/main/kotlin/net/corda/processors/db/internal/schedule/DeduplicationTableCleanUpProcessor.kt index 90bb14fdf30..2d4ae4ad59a 100644 --- a/processors/db-processor/src/main/kotlin/net/corda/processors/db/internal/schedule/DeduplicationTableCleanUpProcessor.kt +++ b/processors/db-processor/src/main/kotlin/net/corda/processors/db/internal/schedule/DeduplicationTableCleanUpProcessor.kt @@ -8,6 +8,7 @@ import net.corda.messaging.api.records.Record import net.corda.orm.JpaEntitiesSet import net.corda.orm.utils.transaction import net.corda.orm.utils.use +import net.corda.schema.Schemas import net.corda.utilities.debug import net.corda.virtualnode.VirtualNodeInfo import net.corda.virtualnode.read.VirtualNodeInfoReadService @@ -21,9 +22,6 @@ class DeduplicationTableCleanUpProcessor( ) : DurableProcessor { companion object { private val log = LoggerFactory.getLogger(DeduplicationTableCleanUpProcessor::class.java) - - // Need to merge with `SchedulerProcessorImpl.DEDUPLICATION_TABLE_CLEAN_UP_TASK` but there isn't currently a good candidate module - private const val DEDUPLICATION_TABLE_CLEAN_UP_TASK = "deduplication-table-clean-up-task" } override val keyClass: Class @@ -36,7 +34,7 @@ class DeduplicationTableCleanUpProcessor( events .forEach { val taskName = it.key - if (taskName == DEDUPLICATION_TABLE_CLEAN_UP_TASK) { + if (taskName == Schemas.ScheduledTask.SCHEDULED_TASK_NAME_DB_PROCESSOR) { log.debug { "Cleaning up deduplication table for all vnodes" } val startTime = System.nanoTime() virtualNodeInfoReadService.getAll() diff --git a/processors/scheduler-processor/src/main/kotlin/net/corda/processors/scheduler/impl/SchedulerProcessorImpl.kt b/processors/scheduler-processor/src/main/kotlin/net/corda/processors/scheduler/impl/SchedulerProcessorImpl.kt index 272c5919b6b..6a8411cb647 100644 --- a/processors/scheduler-processor/src/main/kotlin/net/corda/processors/scheduler/impl/SchedulerProcessorImpl.kt +++ b/processors/scheduler-processor/src/main/kotlin/net/corda/processors/scheduler/impl/SchedulerProcessorImpl.kt @@ -20,7 +20,7 @@ import net.corda.lifecycle.StopEvent import net.corda.lifecycle.createCoordinator import net.corda.orm.JpaEntitiesRegistry import net.corda.processors.scheduler.SchedulerProcessor -import net.corda.schema.Schemas.ScheduledTask.SCHEDULED_TASK_DB_PROCESSOR +import net.corda.schema.Schemas.ScheduledTask import net.corda.schema.configuration.BootConfig import org.osgi.service.component.annotations.Activate import org.osgi.service.component.annotations.Component @@ -51,8 +51,6 @@ class SchedulerProcessorImpl @Activate constructor( companion object { private val logger = LoggerFactory.getLogger(this::class.java.enclosingClass) - - private const val DEDUPLICATION_TABLE_CLEAN_UP_TASK = "deduplication-table-clean-up-task" } private val dependentComponents = DependentComponents.of( @@ -66,7 +64,11 @@ class SchedulerProcessorImpl @Activate constructor( // now just hardcoding schedulers here until CORE-16331 is picked up, when we should take this from config private val schedules = listOf( - Schedule(DEDUPLICATION_TABLE_CLEAN_UP_TASK, 120, SCHEDULED_TASK_DB_PROCESSOR) + Schedule(ScheduledTask.SCHEDULED_TASK_NAME_DB_PROCESSOR, + 120, ScheduledTask.SCHEDULED_TASK_TOPIC_DB_PROCESSOR), + Schedule( + ScheduledTask.SCHEDULED_TASK_NAME_SESSION_TIMEOUT, + 60, ScheduledTask.SCHEDULED_TASK_TOPIC_FLOW_PROCESSOR), ) private var schedulers: Schedulers? = null