diff --git a/audit/messaging/amqp_connection_pool.go b/audit/messaging/amqp_connection_pool.go index 2358f5a..5b17a97 100644 --- a/audit/messaging/amqp_connection_pool.go +++ b/audit/messaging/amqp_connection_pool.go @@ -6,6 +6,7 @@ import ( "fmt" "log/slog" "sync" + "time" ) type AmqpConnectionPool struct { @@ -122,7 +123,7 @@ func (p *AmqpConnectionPool) GetConnection(handle *ConnectionPoolHandle) (*AmqpC // check that accessing the pool only with a valid index (out of bounds should only occur on shutdown) if handle.connectionOffset < len(p.connections) && p.connections[handle.connectionOffset] == nil { - ctx, cancelFn := context.WithTimeout(context.Background(), connectionTimeoutSeconds) + ctx, cancelFn := context.WithTimeout(context.Background(), connectionTimeoutSeconds*time.Second) connection, err := p.internalNewConnection(ctx) cancelFn() if err != nil {