Skip to content

Commit d1a199e

Browse files
wundiiawu
andauthored
fix: handle exceptions when starting the container with a retry (#28)
Co-authored-by: awu <[email protected]>
1 parent 61b3dcb commit d1a199e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Container.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ public function start(): void
7979
exit($exceptionMessage ?? 'Failed to create container');
8080
}
8181

82-
$this->container = $container->start();
82+
try {
83+
$this->container = $container->start();
84+
} catch (Exception) {
85+
usleep(100_000);
86+
$this->container = $container->start();
87+
}
8388

8489
$baseUrl = rtrim($this->getBaseUrl());
8590
$pingUrl = $baseUrl . '/api/v1/ping';

0 commit comments

Comments
 (0)