This commit is contained in:
mats committed 2026-07-26 13:01:07 +02:00
1 parent 540aa48c44
commit bd81f4ff54
8 files changed
+322 -4

No files matched your search

+11 -1
View File
@@ -84,7 +84,17 @@ func Dial(url, name string) (*Conn, error) {
done: make(chan struct{}),
onReconn: make(chan struct{}),
}
raw, err := dial(url, name)
var raw *amqp.Connection
var err error
for attempts := 0; attempts < 10; attempts++ {
raw, err = dial(url, name)
if err == nil {
break
}
if attempts < 9 {
time.Sleep(500 * time.Millisecond)
}
}
if err != nil {
return nil, err
}