From f4a5b6331da52b50d0d8cd6f04332e24f452a5a6 Mon Sep 17 00:00:00 2001 From: Benoit Moriceau Date: Fri, 9 Dec 2022 09:23:24 -0800 Subject: [PATCH 1/2] remove the requirement on the activity --- .../scheduling/activities/ConfigFetchActivityImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java index d8776e6ae55f..e1705d2578c8 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java @@ -41,7 +41,6 @@ @Slf4j @Singleton -@Requires(env = WorkerMode.CONTROL_PLANE) public class ConfigFetchActivityImpl implements ConfigFetchActivity { private final static long MS_PER_SECOND = 1000L; @@ -177,22 +176,22 @@ public GetMaxAttemptOutput getMaxAttempt() { } @Override - public Optional getSourceId(UUID connectionId) { + public Optional getSourceId(final UUID connectionId) { try { final StandardSync standardSync = getStandardSync(connectionId); return Optional.ofNullable(standardSync.getSourceId()); - } catch (JsonValidationException | ConfigNotFoundException | IOException e) { + } catch (final JsonValidationException | ConfigNotFoundException | IOException e) { log.info("Encountered an error fetching the connection's Source ID: ", e); return Optional.empty(); } } @Override - public Optional getStatus(UUID connectionId) { + public Optional getStatus(final UUID connectionId) { try { final StandardSync standardSync = getStandardSync(connectionId); return Optional.ofNullable(standardSync.getStatus()); - } catch (JsonValidationException | ConfigNotFoundException | IOException e) { + } catch (final JsonValidationException | ConfigNotFoundException | IOException e) { log.info("Encountered an error fetching the connection's status: ", e); return Optional.empty(); } From 2e277260b15e0e9d010cf662c788a54819dc12ba Mon Sep 17 00:00:00 2001 From: Benoit Moriceau Date: Fri, 9 Dec 2022 10:58:18 -0800 Subject: [PATCH 2/2] Remove unused import --- .../temporal/scheduling/activities/ConfigFetchActivityImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java index e1705d2578c8..6e48ccfef5a9 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java @@ -8,7 +8,6 @@ import static io.airbyte.metrics.lib.ApmTraceConstants.Tags.CONNECTION_ID_KEY; import datadog.trace.api.Trace; -import io.airbyte.commons.temporal.config.WorkerMode; import io.airbyte.commons.temporal.exception.RetryableException; import io.airbyte.config.Cron; import io.airbyte.config.StandardSync; @@ -21,7 +20,6 @@ import io.airbyte.persistence.job.JobPersistence; import io.airbyte.persistence.job.models.Job; import io.airbyte.validation.json.JsonValidationException; -import io.micronaut.context.annotation.Requires; import io.micronaut.context.annotation.Value; import jakarta.inject.Named; import jakarta.inject.Singleton;