diff --git a/.github/workflows/check-urls.yml b/.github/workflows/check-urls.yml index a6c0bf5..c28d9d8 100644 --- a/.github/workflows/check-urls.yml +++ b/.github/workflows/check-urls.yml @@ -35,9 +35,6 @@ jobs: - name: Run check_urls/main.dart run: dart run main.dart - - name: Run example/lib/rxdart_ext_example.dart - run: dart run example/lib/rxdart_ext_example.dart - run-example: runs-on: ubuntu-latest defaults: diff --git a/check_urls/main.dart b/check_urls/main.dart index 293b25b..39dc088 100644 --- a/check_urls/main.dart +++ b/check_urls/main.dart @@ -37,10 +37,24 @@ Future testUrl(Uri url) async { return success; } +Future testUrlWithRetry(Uri url) async { + var retryCount = 0; + while (true) { + final success = await testUrl(url); + if (success) { + return true; + } + if (retryCount++ >= 3) { + return false; + } + } +} + Future> test(Iterable urls) { return Stream.fromIterable(urls) .map(Uri.parse) - .asyncMap((url) => testUrl(url).then((success) => success ? null : url)) + .asyncMap((url) => + testUrlWithRetry(url).then((success) => success ? null : url)) .where((url) => url != null) .cast() .toList();