improve webhook curl

This commit is contained in:
Ruben Fiszel
2023-09-03 14:55:52 +02:00
parent 70a2c90d62
commit a6df360a8d
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
{"completed":true,"result":{"error":{"name":"Exception","stack":" File \"/tmp/u/ruben/gentle_script.py\", line 35, in main\n print(wmill.get_variable(\"u/admin/adorable_postgresql\"))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n File \"/tmp/windmill/cache/pip/wmill==1.166.0/wmill/client.py\", line 336, in get_variable\n raise Exception(\n","message":"Variable at path u/admin/adorable_postgresql does not exist or you do not have read permissions on it"}}}
@@ -174,10 +174,10 @@ ${
: `
URL="${$page.url.origin}/api/w/${$workspaceStore}/jobs_u/completed/get_result_maybe/$UUID"
while true; do
RESPONSE=$(curl -s -H "Authorization: Bearer $TOKEN" $URL)
COMPLETED=$(echo $RESPONSE | jq .completed)
curl -s -H "Authorization: Bearer $TOKEN" $URL -o res.json
COMPLETED=$(cat res.json | jq .completed)
if [ "$COMPLETED" = "true" ]; then
echo $RESPONSE | jq .result
cat res.json | jq .result
break
else
sleep 1