mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-30 14:04:27 +00:00
Actor: Fix the Apify call syntax and final result URL message
Signed-off-by: Václav Vančura <commit@vancura.dev>
This commit is contained in:
parent
531c135899
commit
193101e52c
@ -48,7 +48,7 @@ readonly ERR_STORAGE_FAILED=14
|
|||||||
# Update error handling with codes.
|
# Update error handling with codes.
|
||||||
if [ -z "$DOCUMENT_URL" ]; then
|
if [ -z "$DOCUMENT_URL" ]; then
|
||||||
echo "Error: Missing document URL. Please provide 'documentUrl' in the input"
|
echo "Error: Missing document URL. Please provide 'documentUrl' in the input"
|
||||||
apify pushData "{\"url\": \"${DOCUMENT_URL}\", \"status\": \"error\", \"error\": \"Missing document URL\"}" || true
|
apify actor:push-data "{\"url\": \"${DOCUMENT_URL}\", \"status\": \"error\", \"error\": \"Missing document URL\"}" || true
|
||||||
exit $ERR_INVALID_INPUT
|
exit $ERR_INVALID_INPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ echo "Validating document URL..."
|
|||||||
if ! curl --output /dev/null --silent --head --fail "${DOCUMENT_URL}"; then
|
if ! curl --output /dev/null --silent --head --fail "${DOCUMENT_URL}"; then
|
||||||
echo "Error: Unable to access document at URL: ${DOCUMENT_URL}"
|
echo "Error: Unable to access document at URL: ${DOCUMENT_URL}"
|
||||||
echo "Please ensure the URL is valid and publicly accessible."
|
echo "Please ensure the URL is valid and publicly accessible."
|
||||||
apify pushData "{\"url\": \"${DOCUMENT_URL}\", \"status\": \"error\", \"error\": \"URL inaccessible\"}" || true
|
apify actor:push-data "{\"url\": \"${DOCUMENT_URL}\", \"status\": \"error\", \"error\": \"URL inaccessible\"}" || true
|
||||||
exit $ERR_URL_INACCESSIBLE
|
exit $ERR_URL_INACCESSIBLE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ apify actor:set-value "OUTPUT_RESULT" --contentType "application/$OUTPUT_FORMAT"
|
|||||||
# Create dataset record with processing results.
|
# Create dataset record with processing results.
|
||||||
RESULT_URL="https://api.apify.com/v2/key-value-stores/${APIFY_DEFAULT_KEY_VALUE_STORE_ID}/records/OUTPUT_RESULT"
|
RESULT_URL="https://api.apify.com/v2/key-value-stores/${APIFY_DEFAULT_KEY_VALUE_STORE_ID}/records/OUTPUT_RESULT"
|
||||||
echo "Adding record to dataset..."
|
echo "Adding record to dataset..."
|
||||||
apify pushData "{\"url\": \"${DOCUMENT_URL}\", \"output_file\": \"${RESULT_URL}\", \"status\": \"success\"}" || {
|
apify actor:push-data "{\"url\": \"${DOCUMENT_URL}\", \"output_file\": \"${RESULT_URL}\", \"status\": \"success\"}" || {
|
||||||
echo "Warning: Failed to push data to dataset"
|
echo "Warning: Failed to push data to dataset"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,4 +178,4 @@ cleanup() {
|
|||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
echo "Processing completed successfully!"
|
echo "Processing completed successfully!"
|
||||||
echo "You can find your results at: '$RESULT_URL'"
|
echo "You can find your results at: ${RESULT_URL}"
|
||||||
|
Loading…
Reference in New Issue
Block a user