Improve Add source/test reliability.

This commit is contained in:
Jay
2026-04-15 13:56:58 -04:00
parent 12b6ac1a62
commit 901654745f
2 changed files with 12 additions and 7 deletions

View File

@@ -113,6 +113,10 @@ func (p *Pool) Add(rawURL string) error {
// Check for existing connection in pool
p.mu.Lock()
if p.closed {
p.mu.Unlock()
return errors.NewPoolError("pool is closed")
}
_, exists := p.connections[url]
p.mu.Unlock()