fix(core,jdbc): PurgeLog with levels in postgres

Fixes #4604
This commit is contained in:
Loïc Mathieu
2024-08-08 12:23:50 +02:00
parent 22bd56ae9a
commit 3881d778a4
5 changed files with 14 additions and 11 deletions

View File

@@ -10,6 +10,7 @@ import org.jooq.impl.DSL;
import org.slf4j.event.Level;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@@ -27,10 +28,9 @@ public class PostgresLogRepository extends AbstractJdbcLogRepository {
}
@Override
protected Condition minLevel(Level minLevel) {
protected Condition levelsCondition(List<Level> levels) {
return DSL.condition("level in (" +
LogEntry
.findLevelsByMin(minLevel)
levels
.stream()
.map(s -> "'" + s + "'::log_level")
.collect(Collectors.joining(", ")) +