From cdb26b52238e0c54f209d9cfdf6a7400338d6266 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Mon, 9 Jan 2023 17:56:24 +0000 Subject: [PATCH] Make Telodendria Bot retry fetching if it failed. --- tools/bin/tp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/bin/tp b/tools/bin/tp index 5f1a593..b35ea7e 100755 --- a/tools/bin/tp +++ b/tools/bin/tp @@ -51,7 +51,12 @@ case "$1" in continue fi - $CURL -o "$TP_DIR/ingress/$id.patch" "$HOMESERVER/media/v3/download/$server/$id" + if ! $CURL -o "$TP_DIR/ingress/$id.patch" "$HOMESERVER/media/v3/download/$server/$id"; then + rm "$TP_DIR"/ingress/$id.patch" + echo "Failed to fetch mxc://$server/$id." + echo "Will try again next time." + continue + fi count=$(cat "$TP_DIR/count.txt") count=$((count + 1))