Skip to content

Commit

Permalink
fix(backend): don't run the scheduled task every 60 ms #960
Browse files Browse the repository at this point in the history
  • Loading branch information
fengelniederhammer committed Feb 9, 2024
1 parent 008ab71 commit 0801274
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.loculus.backend.config.BackendSpringProperty
import org.springframework.beans.factory.annotation.Value
import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Component
import java.util.concurrent.TimeUnit

private val log = mu.KotlinLogging.logger {}

Expand All @@ -12,7 +13,7 @@ class CleanUpStaleSequencesInProcessingTask(
private val submissionDatabaseService: SubmissionDatabaseService,
@Value("\${${BackendSpringProperty.STALE_AFTER_SECONDS}}") private val timeToStaleInSeconds: Long,
) {
@Scheduled(fixedRateString = "\${${BackendSpringProperty.CLEAN_UP_RUN_EVERY_SECONDS}}")
@Scheduled(fixedRateString = "\${${BackendSpringProperty.CLEAN_UP_RUN_EVERY_SECONDS}}", timeUnit = TimeUnit.SECONDS)
fun task() {
log.info { "Cleaning up stale sequences in processing, timeToStaleInSeconds: $timeToStaleInSeconds" }
submissionDatabaseService.cleanUpStaleSequencesInProcessing(timeToStaleInSeconds)
Expand Down

0 comments on commit 0801274

Please sign in to comment.