#1209: JobHandlerScheduler.kt

projectforge-business/src/main/kotlin/org/projectforge/framework/jobs/JobHandlerScheduler.kt Spring Component / Scheduler, projectforge-business/src/main/kotlin/org/projectforge/framework/jobs/JobHandlerScheduler.kt 43 lines · 16 code · 23 comments · 4 blank
Spring @Scheduled component that triggers JobHandler.tidyUp() every minute with a 1-minute initial delay. Each execution runs in a separate thread to avoid blocking the Spring scheduler thread.

Architecture

Class Details

Scheduling

AnnotationValue
@Scheduled(fixedDelay)Constants.MILLIS_PER_MINUTE
@Scheduled(initialDelay)Constants.MILLIS_PER_MINUTE

Thread Model

The execute() method spawns a new Thread { jobHandler.tidyUp() }.start() to ensure the Spring scheduler thread is never blocked by potentially long-running cleanup operations.

Git History

868d6abb7 2025 -> 2026
2720010a9 Scheduled jobs: all jobs are now started in own thread (for avoiding blocking spring scheduler).
63081666f Source file headers: 2024-> 2025.
b6092df09 Copyright 2023 -> 2024
f912d13b2 Source file header
a060d94b0 JobHandler was not scheduled. Fixed.