Skip to content

Commit c74d9d1

Browse files
author
Илья
committed
Use first discovery in retry
1 parent 9b32d63 commit c74d9d1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Ydb.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public function __construct($config = [], LoggerInterface $logger = null)
107107
$this->logger = new NullLogger();
108108
}
109109

110+
$this->retry = new Retry($this->logger);
111+
110112
if(isset($config['credentials'])){
111113
$this->iam_config['credentials'] = $config['credentials'];
112114
$config['credentials']->setLogger($this->logger());
@@ -118,10 +120,11 @@ public function __construct($config = [], LoggerInterface $logger = null)
118120
if (isset($config['discoveryInterval'])){
119121
$this->discoveryInterval = $config['discoveryInterval'];
120122
}
121-
$this->discover();
122-
}
123123

124-
$this->retry = new Retry($this->logger);
124+
$this->retry(function (){
125+
$this->discover();
126+
}, true);
127+
}
125128

126129
$this->logger()->info('YDB: Initialized');
127130
}

0 commit comments

Comments
 (0)