mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 11:06:32 +00:00
[AZ-178] Implement streaming video detection endpoint
- Added `/detect/video` endpoint for true streaming video detection, allowing inference to start as upload bytes arrive. - Introduced `run_detect_video_stream` method in the inference module to handle video processing from a file-like object. - Updated media hashing to include a new function for computing hashes directly from files with minimal I/O. - Enhanced documentation to reflect changes in video processing and API behavior. Made-with: Cursor
This commit is contained in:
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
HOST="${HEALTH_CHECK_HOST:-localhost}"
|
||||
PORT="${HEALTH_CHECK_PORT:-8080}"
|
||||
MAX_RETRIES=10
|
||||
RETRY_INTERVAL=3
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [--help]"
|
||||
echo "Check health of Azaion.Detections service."
|
||||
echo ""
|
||||
echo "Environment variables:"
|
||||
echo " HEALTH_CHECK_HOST Target host (default: localhost)"
|
||||
echo " HEALTH_CHECK_PORT Target port (default: 8080)"
|
||||
exit 0
|
||||
}
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--help) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
URL="http://${HOST}:${PORT}/health"
|
||||
echo "Checking health at $URL ..."
|
||||
|
||||
for i in $(seq 1 "$MAX_RETRIES"); do
|
||||
if curl -sf "$URL" > /dev/null 2>&1; then
|
||||
RESPONSE="$(curl -sf "$URL")"
|
||||
echo "Health check passed (attempt $i/$MAX_RETRIES): $RESPONSE"
|
||||
exit 0
|
||||
fi
|
||||
echo "Attempt $i/$MAX_RETRIES failed, retrying in ${RETRY_INTERVAL}s..."
|
||||
sleep "$RETRY_INTERVAL"
|
||||
done
|
||||
|
||||
echo "ERROR: Health check failed after $MAX_RETRIES attempts."
|
||||
exit 1
|
||||
Reference in New Issue
Block a user