Skip to content

Commit

Permalink
fix(jdbc): abstract class should not be singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Jul 10, 2024
1 parent fc506c4 commit ca39794
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.micronaut.data.model.Pageable;
import io.micronaut.inject.qualifiers.Qualifiers;
import jakarta.annotation.Nullable;
import jakarta.inject.Singleton;
import lombok.SneakyThrows;
import org.apache.commons.lang3.tuple.Pair;
import org.jooq.Condition;
Expand Down Expand Up @@ -59,7 +58,6 @@
import java.util.function.Function;
import java.util.stream.Collectors;

@Singleton
public abstract class AbstractJdbcExecutionRepository extends AbstractJdbcRepository implements ExecutionRepositoryInterface, JdbcIndexerInterface<Execution> {
protected final io.kestra.jdbc.AbstractJdbcRepository<Execution> jdbcRepository;
private final ApplicationEventPublisher<CrudEvent<Execution>> eventPublisher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import io.kestra.jdbc.runner.JdbcIndexerInterface;
import io.micronaut.data.model.Pageable;
import jakarta.annotation.Nullable;
import jakarta.inject.Singleton;
import org.jooq.Record;
import org.jooq.*;
import org.jooq.impl.DSL;
Expand All @@ -25,7 +24,6 @@
import java.util.*;
import java.util.stream.Collectors;

@Singleton
public abstract class AbstractJdbcLogRepository extends AbstractJdbcRepository implements LogRepositoryInterface, JdbcIndexerInterface<LogEntry> {
protected io.kestra.jdbc.AbstractJdbcRepository<LogEntry> jdbcRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import io.kestra.jdbc.runner.JdbcIndexerInterface;
import io.micrometer.common.lang.Nullable;
import io.micronaut.data.model.Pageable;
import jakarta.inject.Singleton;
import org.jooq.*;
import org.jooq.impl.DSL;

Expand All @@ -24,7 +23,6 @@
import java.util.Map;
import java.util.function.Function;

@Singleton
public abstract class AbstractJdbcMetricRepository extends AbstractJdbcRepository implements MetricRepositoryInterface, JdbcIndexerInterface<MetricEntry> {
protected io.kestra.jdbc.AbstractJdbcRepository<MetricEntry> jdbcRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.kestra.core.utils.DateUtils;
import io.micronaut.core.annotation.Nullable;
import jakarta.inject.Singleton;
import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.impl.DSL;
Expand All @@ -12,7 +11,6 @@
import java.util.Date;
import java.util.List;

@Singleton
public abstract class AbstractJdbcRepository {
protected Condition defaultFilter() {
return field("deleted", Boolean.class).eq(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import io.kestra.core.server.ServiceInstance;
import io.kestra.core.server.ServiceStateTransition;
import io.micronaut.data.model.Pageable;
import jakarta.inject.Singleton;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.ImmutablePair;
Expand All @@ -30,7 +29,6 @@

import static org.jooq.impl.DSL.using;

@Singleton
@Getter
@Slf4j
public abstract class AbstractJdbcServiceInstanceRepository extends AbstractJdbcRepository implements ServiceInstanceRepositoryInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import io.kestra.core.repositories.SettingRepositoryInterface;
import io.micronaut.context.ApplicationContext;
import io.micronaut.context.event.ApplicationEventPublisher;
import jakarta.inject.Singleton;
import lombok.SneakyThrows;
import org.jooq.Field;
import org.jooq.Record1;
Expand All @@ -18,7 +17,6 @@
import java.util.Map;
import java.util.Optional;

@Singleton
public abstract class AbstractJdbcSettingRepository extends AbstractJdbcRepository implements SettingRepositoryInterface {
protected final io.kestra.jdbc.AbstractJdbcRepository<Setting> jdbcRepository;
private final ApplicationEventPublisher<CrudEvent<Setting>> eventPublisher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import io.micronaut.context.event.ApplicationEventPublisher;
import io.micronaut.data.model.Pageable;
import io.micronaut.inject.qualifiers.Qualifiers;
import jakarta.inject.Singleton;
import org.jooq.*;
import org.jooq.impl.DSL;

Expand All @@ -20,7 +19,6 @@
import jakarta.annotation.Nullable;
import jakarta.validation.ConstraintViolationException;

@Singleton
public abstract class AbstractJdbcTemplateRepository extends AbstractJdbcRepository implements TemplateRepositoryInterface {
private final QueueInterface<Template> templateQueue;
private final ApplicationEventPublisher<CrudEvent<Template>> eventPublisher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import io.kestra.jdbc.runner.JdbcIndexerInterface;
import io.kestra.jdbc.runner.JdbcSchedulerContext;
import io.micronaut.data.model.Pageable;
import jakarta.inject.Singleton;
import org.jooq.*;
import org.jooq.impl.DSL;
import reactor.core.publisher.Flux;
Expand All @@ -24,7 +23,6 @@
import java.util.Optional;
import java.util.function.Function;

@Singleton
public abstract class AbstractJdbcTriggerRepository extends AbstractJdbcRepository implements TriggerRepositoryInterface, JdbcIndexerInterface<Trigger> {
protected io.kestra.jdbc.AbstractJdbcRepository<Trigger> jdbcRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.kestra.core.repositories.WorkerJobRunningRepositoryInterface;
import io.kestra.core.runners.WorkerJobRunning;
import jakarta.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import org.jooq.DSLContext;
import org.jooq.Record1;
Expand All @@ -12,7 +11,6 @@
import java.util.List;
import java.util.Optional;

@Singleton
@Slf4j
public abstract class AbstractJdbcWorkerJobRunningRepository extends AbstractJdbcRepository implements WorkerJobRunningRepositoryInterface {
protected io.kestra.jdbc.AbstractJdbcRepository<WorkerJobRunning> jdbcRepository;
Expand Down

0 comments on commit ca39794

Please sign in to comment.