duplicate ip fix -1
This commit is contained in:
parent
5c06c43457
commit
d738a5f603
@ -771,9 +771,11 @@ spec:
|
|||||||
|
|
||||||
# Get or create app_id (using INSERT ... ON DUPLICATE KEY UPDATE for idempotency)
|
# Get or create app_id (using INSERT ... ON DUPLICATE KEY UPDATE for idempotency)
|
||||||
echo " Ensuring app entry exists for: $app_name"
|
echo " Ensuring app entry exists for: $app_name"
|
||||||
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()"
|
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
|
||||||
|
|
||||||
APP_ID=$(run_mysql "SELECT id FROM apps WHERE name='$app_name'")
|
APP_ID=$(run_mysql "SELECT id FROM apps WHERE name='$app_name'" || echo "")
|
||||||
|
|
||||||
if [ -z "$APP_ID" ]; then
|
if [ -z "$APP_ID" ]; then
|
||||||
echo " Failed to get app_id for: $app_name"
|
echo " Failed to get app_id for: $app_name"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user