Skip to content

Commit

Permalink
Add healthcheck (#11)
Browse files Browse the repository at this point in the history
* Add healthcheck

* Remove Retries from test
  • Loading branch information
blankse authored Aug 3, 2022
1 parent c24dd96 commit 6432b2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 2 additions & 0 deletions docker-compose.pdfreactor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ services:
- "./pdfreactor:/ro/config"
external_links:
- "ddev-router:${DDEV_SITENAME}.${DDEV_TLD}"
healthcheck:
test: ["CMD-SHELL", "curl --fail -s localhost:9423"]
11 changes: 1 addition & 10 deletions tests/testdata/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use com\realobjects\pdfreactor\webservice\client\PDFreactor as PDFreactor;
use com\realobjects\pdfreactor\webservice\client\LogLevel as LogLevel;
use com\realobjects\pdfreactor\webservice\client\UnreachableServiceException;
use com\realobjects\pdfreactor\webservice\client\ViewerPreferences as ViewerPreferences;

$content = file_get_contents('resources/content.html');
Expand Down Expand Up @@ -37,15 +36,7 @@
],
];

for ($i = 0; $i < 5; $i++) {
try {
$result = $pdfReactor->convertAsBinary($config);
break;
} catch (UnreachableServiceException $e) {
echo 'PDF Reactor Server unreachable. Retry in 10 seconds.' . "\n";
sleep(10);
}
}
$result = $pdfReactor->convertAsBinary($config);

if (preg_match('/^%PDF-/', $result)) {
echo 'PDF generation was successful' . "\n";
Expand Down

0 comments on commit 6432b2a

Please sign in to comment.