From e29d5ff0e2e8bbd9fc8cc5c1f0484af954a4e96d Mon Sep 17 00:00:00 2001 From: Marcos Marx Date: Sun, 11 Dec 2022 17:37:34 -0300 Subject: [PATCH] Airbyte Cron: renable schedule to file cleaner (#20317) * readd schedule to cleaner * import scheduled --- .../main/java/io/airbyte/cron/selfhealing/WorkspaceCleaner.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/airbyte-cron/src/main/java/io/airbyte/cron/selfhealing/WorkspaceCleaner.java b/airbyte-cron/src/main/java/io/airbyte/cron/selfhealing/WorkspaceCleaner.java index dfae48e00e25..8ebb2203a692 100644 --- a/airbyte-cron/src/main/java/io/airbyte/cron/selfhealing/WorkspaceCleaner.java +++ b/airbyte-cron/src/main/java/io/airbyte/cron/selfhealing/WorkspaceCleaner.java @@ -12,6 +12,7 @@ import io.airbyte.metrics.lib.ApmTraceUtils; import io.micronaut.context.annotation.Requires; import io.micronaut.context.env.Environment; +import io.micronaut.scheduling.annotation.Scheduled; import jakarta.inject.Singleton; import java.io.File; import java.io.IOException; @@ -52,6 +53,7 @@ public class WorkspaceCleaner { * NOTE: this is currently only intended to work for docker */ @Trace(operationName = SCHEDULED_TRACE_OPERATION_NAME) + @Scheduled(fixedRate = "1d") public void deleteOldFiles() throws IOException { final Date oldestAllowed = getDateFromDaysAgo(maxAgeFilesInDays); log.info("Deleting files older than {} days ({})", maxAgeFilesInDays, oldestAllowed);