From aebc49772eb9ec8165e59ffc17df6701b15cbb55 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Thu, 23 Nov 2023 20:01:54 -0800 Subject: [PATCH] Fix: exit check_cached_webmentions early --- scripts/get-webmentions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/get-webmentions.sh b/scripts/get-webmentions.sh index e09042a..b01a0ab 100644 --- a/scripts/get-webmentions.sh +++ b/scripts/get-webmentions.sh @@ -24,8 +24,6 @@ check_cached_webmentions() { expires_in="$fallback_stale_after_minutes" if [ $# -gt 0 ]; then expires_in="$1" - else - echo "Failed to fetch webmentions. Using fallback cache expiry." fi exit_status=1 if [ -f "$webmentions_file" ]; then @@ -34,12 +32,14 @@ check_cached_webmentions() { echo 'Using cached webmentions' skip_check=1 exit_status=0 + return 0 fi + return 1 fi if [ "$exit_status" = 1 ] && [ "$times_run" = 2 ]; then echo "Webmentions are outdated. failed to fetch for over a day." + exit "$exit_status" fi - exit "$exit_status" fi }