feat: added application_name
Integration Tests / integration-test (push) Failing after 1m0s

This commit is contained in:
2026-09-18 23:08:31 +02:00
parent b35017b832
commit 7c8d0bdc99
9 changed files with 87 additions and 20 deletions
+5 -2
View File
@@ -2,6 +2,7 @@ package config
import (
"fmt"
"strings"
"time"
"git.warky.dev/wdevs/pgsql-broker/pkg/broker/adapter"
@@ -47,7 +48,7 @@ type BrokerConfig struct {
QueueTimerSec int `mapstructure:"queue_timer_sec"`
QueueBufferSize int `mapstructure:"queue_buffer_size"`
WorkerIdleTimeoutSec int `mapstructure:"worker_idle_timeout_sec"`
NotifyRetrySeconds time.Duration `mapstructure:"notify_retry_seconds"`
NotifyRetryInterval time.Duration `mapstructure:"notify_retry_seconds"`
EnableDebug bool `mapstructure:"enable_debug"`
// LeaseSeconds is how long a claimed job's lease is valid for before
// broker_recover_stale_jobs considers it abandoned.
@@ -132,7 +133,8 @@ func validateConfig(config *Config) error {
}
// Validate each database configuration
for i, db := range config.Databases {
for i := range config.Databases {
db := &config.Databases[i]
if db.Name == "" {
return fmt.Errorf("database[%d]: name is required", i)
}
@@ -195,5 +197,6 @@ func (d *DatabaseConfig) ToPostgresConfig() adapter.PostgresConfig {
MaxIdleConns: d.MaxIdleConns,
ConnMaxLifetime: d.ConnMaxLifetime,
ConnMaxIdleTime: d.ConnMaxIdleTime,
ApplicationName: fmt.Sprintf("PGSQL_BROKER_%s", strings.ToUpper(d.Name)),
}
}