Make Telodendria Bot retry fetching if it failed.

This commit is contained in:
Jordan Bancino 2023-01-09 17:56:24 +00:00
parent 90a74c3b0a
commit cdb26b5223

View file

@ -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))