Skip to content

Commit

Permalink
fix(jdbc-postgres): remove not-needed serialization in Postgres queue
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Aug 22, 2024
1 parent d9e18d5 commit 04ce98e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.kestra.repository.postgres;

import com.google.common.collect.ImmutableMap;
import io.kestra.core.queues.QueueService;
import io.kestra.core.repositories.ArrayListTotal;
import io.kestra.jdbc.JdbcMapper;
Expand All @@ -21,6 +22,7 @@
import org.jooq.SelectConditionStep;
import org.jooq.impl.DSL;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jakarta.annotation.Nullable;
Expand Down Expand Up @@ -52,12 +54,10 @@ public Condition fullTextCondition(List<String> fields, String query) {
@SneakyThrows
@Override
public Map<Field<Object>, Object> persistFields(T entity) {
Map<Field<Object>, Object> fields = super.persistFields(entity);

String json = JdbcMapper.of().writeValueAsString(entity);
fields.replace(AbstractJdbcRepository.field("value"), DSL.val(JSONB.valueOf(json)));

return fields;
return new HashMap<>(ImmutableMap
.of(io.kestra.jdbc.repository.AbstractJdbcRepository.field("value"), DSL.val(JSONB.valueOf(json)))
);
}

@SneakyThrows
Expand Down

0 comments on commit 04ce98e

Please sign in to comment.