Fix data fetch 7

This commit is contained in:
Urtzi Alfaro
2025-07-27 22:58:18 +02:00
parent 0201b428e5
commit 946015b80c
8 changed files with 138 additions and 100 deletions

View File

@@ -675,7 +675,7 @@ echo "Training HTTP Status Code: $HTTP_CODE"
echo "Training Response:"
echo "$TRAINING_RESPONSE" | python3 -m json.tool 2>/dev/null || echo "$TRAINING_RESPONSE"
TRAINING_TASK_ID=$(extract_json_field "$TRAINING_RESPONSE" "task_id")
TRAINING_TASK_ID=$(extract_json_field "$TRAINING_RESPONSE" "job_id")
if [ -z "$TRAINING_TASK_ID" ]; then
TRAINING_TASK_ID=$(extract_json_field "$TRAINING_RESPONSE" "id")
fi
@@ -686,13 +686,13 @@ if [ -n "$TRAINING_TASK_ID" ]; then
log_step "4.2. Monitoring training progress"
# Poll training status (limited polling for test)
MAX_POLLS=5
MAX_POLLS=100
POLL_COUNT=0
while [ $POLL_COUNT -lt $MAX_POLLS ]; do
echo "Polling training status... ($((POLL_COUNT+1))/$MAX_POLLS)"
STATUS_RESPONSE=$(curl -s -X GET "$API_BASE/api/v1/tenants/$TENANT_ID/training/status/$TRAINING_TASK_ID" \
STATUS_RESPONSE=$(curl -s -X GET "$API_BASE/api/v1/tenants/$TENANT_ID/training/jobs/$TRAINING_TASK_ID" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "X-Tenant-ID: $TENANT_ID")