fix: better condition

Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com>
This commit is contained in:
Michael Todorovic 2024-11-27 18:14:48 +01:00 committed by Nicolas Rodriguez
parent 1c66044856
commit d55dd27b78

View File

@ -110,8 +110,8 @@ var (
func (c PGStatCheckpointerCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error { func (c PGStatCheckpointerCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error {
db := instance.getDB() db := instance.getDB()
before17 := instance.version.Compare(semver.MustParse("17.0.0")) before17 := instance.version.LT(semver.MustParse("17.0.0"))
if before17 < 0 { if before17 {
c.log.Warn("pg_stat_checkpointer collector is not available on PostgreSQL < 17.0.0, skipping") c.log.Warn("pg_stat_checkpointer collector is not available on PostgreSQL < 17.0.0, skipping")
return nil return nil
} }