Skip to content

Commit

Permalink
chore(sql): Injecting objectMapper instead of creating a new instance (
Browse files Browse the repository at this point in the history
…#4855)

- Updated to use the same objectMapper used elsewhere

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
jeyrschabu and mergify[bot] committed Aug 31, 2020
1 parent ba0ab57 commit 7d837c2
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -51,19 +51,21 @@ class SqlConfiguration {
@ConditionalOnProperty("sql.task-repository.enabled")
fun sqlTaskRepository(
jooq: DSLContext,
clock: Clock
clock: Clock,
objectMapper: ObjectMapper
): TaskRepository =
SqlTaskRepository(jooq, ObjectMapper(), clock, ConnectionPools.TASKS.value)
SqlTaskRepository(jooq, objectMapper, clock, ConnectionPools.TASKS.value)

@Bean
@ConditionalOnProperty("sql.task-repository.enabled", "sql.task-repository.secondary.enabled")
fun secondarySqlTaskRepository(
jooq: DSLContext,
clock: Clock,
objectMapper: ObjectMapper,
@Value("\${sql.task-repository.secondary.pool-name}") poolName: String

): TaskRepository =
SqlTaskRepository(jooq, ObjectMapper(), clock, poolName)
SqlTaskRepository(jooq, objectMapper, clock, poolName)

@Bean
@ConditionalOnProperty("sql.task-repository.enabled")
Expand Down

0 comments on commit 7d837c2

Please sign in to comment.