Skip to content

Commit

Permalink
🐛 cron/workspace-cleaner: only run task for docker environments (#17168)
Browse files Browse the repository at this point in the history
* dont run cleanup on kubernetes

* use the micronaut way™

* add env var to kube resource

* use micronaut environment instead

* no need for the env var
  • Loading branch information
pedroslopez committed Sep 29, 2022
1 parent 55d27a5 commit 12b4669
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import io.airbyte.config.Configs;
import io.airbyte.config.EnvConfigs;
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;
Expand All @@ -22,12 +24,15 @@

@Singleton
@Slf4j
@Requires(notEnv = Environment.KUBERNETES)
public class WorkspaceCleaner {

private final Path workspaceRoot;
private final long maxAgeFilesInDays;

WorkspaceCleaner() {
log.info("Creating workspace cleaner");

// TODO Configs should get injected through micronaut
final Configs configs = new EnvConfigs();

Expand Down
2 changes: 1 addition & 1 deletion airbyte-cron/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
micronaut:
application:
name: airbyte-workers
name: airbyte-cron
security:
intercept-url-map:
- pattern: /**
Expand Down

0 comments on commit 12b4669

Please sign in to comment.