fixup! Add pool management.

This commit is contained in:
2025-11-18 18:00:21 +00:00
parent 97cf896a17
commit 6c55bccc20
2 changed files with 9 additions and 8 deletions
+7 -8
View File
@@ -236,16 +236,15 @@ func (b *BaseClient) refreshConnectionPool() {
// StopPoolMonitor gracefully stops the pool health monitor
// Call this when shutting down the application
// Uses sync.Once to ensure it only executes once, preventing race conditions
func (b *BaseClient) StopPoolMonitor() {
if b.pool_warmup_enabled {
b.Logger.Info(&libpack_logger.LogMessage{
Message: "Stopping pool monitor",
Pairs: nil,
b.pool_stop_once.Do(func() {
b.Logger.Info(&libpack_logger.LogMessage{
Message: "Stopping pool monitor",
Pairs: nil,
})
b.pool_stop <- true
})
select {
case b.pool_stop <- true:
default:
// Channel already has a value or monitor already stopped
}
}
}