Skip to content

Commit

Permalink
MSEARCH-794: fix status setting query
Browse files Browse the repository at this point in the history
  • Loading branch information
mukhiddin-yusuf committed Aug 16, 2024
1 parent 9477a74 commit eda6901
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ReindexStatusRepository {
private static final String UPDATE_FOR_ENTITIES_SQL = """
UPDATE %s
SET %s
WHERE entity_type in (?);
WHERE entity_type in (%s);
""";

private final FolioExecutionContext context;
Expand All @@ -65,12 +65,11 @@ public void setReindexMergeFailed(List<ReindexEntityType> entityTypes) {
.collect(Collectors.joining(","));
var fullTableName = getFullTableName(context, REINDEX_STATUS_TABLE);
var sql = UPDATE_FOR_ENTITIES_SQL.formatted(
fullTableName, "%s = ?, %s = ?".formatted(STATUS_COLUMN, END_TIME_MERGE_COLUMN));
fullTableName, "%s = ?, %s = ?".formatted(STATUS_COLUMN, END_TIME_MERGE_COLUMN), inTypes);

log.info("inTypes: {}", inTypes);
log.info("sql: {}", sql);
var status = "'%s'".formatted(ReindexStatus.MERGE_FAILED.name());
jdbcTemplate.update(sql, status, Timestamp.from(Instant.now()), inTypes);
jdbcTemplate.update(sql, ReindexStatus.MERGE_FAILED.name(), Timestamp.from(Instant.now()), inTypes);
}

public void saveReindexStatusRecords(List<ReindexStatusEntity> statusRecords) {
Expand Down

0 comments on commit eda6901

Please sign in to comment.