|
6 | 6 | # [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes.
|
7 | 7 | # Changes are relevant to this script and the support docs.mk GNU Make interface.
|
8 | 8 |
|
| 9 | +# ## 4.2.0 (2023-09-01) |
| 10 | + |
| 11 | +# ### Added |
| 12 | + |
| 13 | +# - Retry the initial webserver request up to ten times to allow for the process to start. |
| 14 | +# If it is still failing after ten seconds, an error message is logged. |
| 15 | + |
9 | 16 | # ## 4.1.1 (2023-07-20)
|
10 | 17 |
|
11 | 18 | # ### Fixed
|
@@ -439,30 +446,39 @@ await_build() {
|
439 | 446 | url="$1"
|
440 | 447 | req="$(if command -v curl >/dev/null 2>&1; then echo 'curl -s -o /dev/null'; else echo 'wget -q'; fi)"
|
441 | 448 |
|
442 |
| - sleep 2 |
443 |
| - |
444 |
| - if ${req} "${url}"; then |
445 |
| - echo |
446 |
| - echo "View documentation locally:" |
447 |
| - for x in ${url_src_dst_vers}; do |
448 |
| - IFS='^' read -r url _ _ <<POSIX_HERESTRING |
| 449 | + i=1 |
| 450 | + max=10 |
| 451 | + while [ "${i}" -ne "${max}" ] |
| 452 | + do |
| 453 | + sleep 1 |
| 454 | + debg "Retrying request to webserver assuming the process is still starting up." |
| 455 | + i=$((i + 1)) |
| 456 | + |
| 457 | + if ${req} "${url}"; then |
| 458 | + echo |
| 459 | + echo "View documentation locally:" |
| 460 | + for x in ${url_src_dst_vers}; do |
| 461 | + IFS='^' read -r url _ _ <<POSIX_HERESTRING |
449 | 462 | $x
|
450 | 463 | POSIX_HERESTRING
|
451 | 464 |
|
452 |
| - if [ -n "${url}" ]; then |
453 |
| - if [ "${_url}" != "arbitrary" ]; then |
454 |
| - echo " ${url}" |
| 465 | + if [ -n "${url}" ]; then |
| 466 | + if [ "${_url}" != "arbitrary" ]; then |
| 467 | + echo " ${url}" |
| 468 | + fi |
455 | 469 | fi
|
456 |
| - fi |
457 |
| - done |
458 |
| - echo |
459 |
| - echo 'Press Ctrl+C to stop the server' |
460 |
| - else |
461 |
| - echo |
462 |
| - errr 'The build was interrupted or a build error occurred, check the previous logs for possible causes.' |
463 |
| - fi |
| 470 | + done |
| 471 | + echo |
| 472 | + echo 'Press Ctrl+C to stop the server' |
| 473 | + |
| 474 | + unset i max req url |
| 475 | + return |
| 476 | + fi |
| 477 | + done |
464 | 478 |
|
465 |
| - unset url req |
| 479 | + echo |
| 480 | + errr 'The build was interrupted or a build error occurred, check the previous logs for possible causes.' |
| 481 | + unset i max req url |
466 | 482 | }
|
467 | 483 |
|
468 | 484 | debg() {
|
|
0 commit comments