debug added for ip
This commit is contained in:
parent
d3d1f94c04
commit
b887bf2919
@ -777,11 +777,19 @@ spec:
|
||||
|
||||
# Get or create app_id (using INSERT ... ON DUPLICATE KEY UPDATE for idempotency)
|
||||
echo " Ensuring app entry exists for: $app_name"
|
||||
if ! run_mysql "INSERT INTO apps (name, token, creation_date, last_update, is_deleted) VALUES ('$app_name', UUID(), NOW(), NOW(), 0) ON DUPLICATE KEY UPDATE last_update=NOW()"; then
|
||||
echo " Warning: INSERT command returned non-zero, but continuing..."
|
||||
fi
|
||||
INSERT_RESULT=$(run_mysql "INSERT INTO apps (name, token, creation_date, last_update, is_deleted) VALUES ('$app_name', UUID(), NOW(), NOW(), 0) ON DUPLICATE KEY UPDATE last_update=NOW()" 2>&1) || true
|
||||
echo " INSERT result: '$INSERT_RESULT'"
|
||||
|
||||
APP_ID=$(run_mysql "SELECT id FROM apps WHERE name='$app_name'" || echo "")
|
||||
# Debug: Show all apps in table
|
||||
echo " DEBUG: Listing apps in database..."
|
||||
run_mysql "SELECT id, name FROM apps LIMIT 10" 2>&1 || true
|
||||
|
||||
APP_ID=$(run_mysql "SELECT id FROM apps WHERE name='$app_name'" 2>&1) || true
|
||||
echo " DEBUG: Raw APP_ID result: '$APP_ID'"
|
||||
|
||||
# Clean APP_ID - remove any non-numeric characters
|
||||
APP_ID=$(echo "$APP_ID" | grep -o '[0-9]*' | head -1)
|
||||
echo " DEBUG: Cleaned APP_ID: '$APP_ID'"
|
||||
|
||||
if [ -z "$APP_ID" ]; then
|
||||
echo " Failed to get app_id for: $app_name"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user