Skip to content

Commit

Permalink
feat(backend): address comments2
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasKampmann authored and fengelniederhammer committed Feb 8, 2024
1 parent d8e0e1e commit 79d1bbf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .idea/runConfigurations/BackendApplicationKt.run.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import javax.sql.DataSource

object BackendSpringProperty {
const val BACKEND_CONFIG_PATH = "loculus.config.path"
const val ENABLE_CLEAN_UP_TASK = "loculus.cleanup.task.enabled"
const val STALE_AFTER_SECONDS = "loculus.cleanup.task.reset-stale-in-processing-every-seconds"
const val STALE_AFTER_SECONDS = "loculus.cleanup.task.reset-stale-in-processing-after-seconds"
const val CLEAN_UP_RUN_EVERY_SECONDS = "loculus.cleanup.task.run-every-seconds"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ package org.loculus.backend.service.submission

import org.loculus.backend.config.BackendSpringProperty
import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Component

private val log = mu.KotlinLogging.logger {}

@Component
@ConditionalOnProperty(
name = ["\${${BackendSpringProperty.ENABLE_CLEAN_UP_TASK}}"],
havingValue = "true",
matchIfMissing = true,
)
class CleanUpStaleSequencesInProcessingTask(
private val submissionDatabaseService: SubmissionDatabaseService,
@Value("\${${BackendSpringProperty.STALE_AFTER_SECONDS}}") private val timeToStaleInSeconds: Long,
Expand Down
4 changes: 2 additions & 2 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ management.endpoints.web.exposure.include=health
management.health.livenessState.enabled=true
management.health.readinessState.enabled=true

loculus.cleanup.task.reset-stale-in-processing-every-seconds=60
loculus.cleanup.task.reset-stale-in-processing-after-seconds=60
loculus.cleanup.task.run-every-seconds=60
loculus.cleanup.task.enabled=true

0 comments on commit 79d1bbf

Please sign in to comment.