[Added] Nightly filling up of fresh data (and swapping), Startup filling of DB, sessionToken for bulk gathering

This commit is contained in:
Ninjaws
2024-11-03 01:43:47 +01:00
parent 121dff910d
commit ec5a1de584
28 changed files with 365 additions and 700 deletions
+2 -5
View File
@@ -1,7 +1,6 @@
#!/bin/bash
# Step 1: Get the sessionId from the questions endpoint
sessionIdJson=$(curl -s "http://localhost:9090/quiz/questions?amount=25&category=27&difficulty=medium&type=boolean")
sessionIdJson=$(curl -s "http://localhost:9090/quiz/questions?amount=20&category=27&difficulty=medium&type=multiple")
statusCode=$(echo "$sessionIdJson" | grep -o '"statusCode":[0-9]*' | sed 's/"statusCode"://')
@@ -22,8 +21,7 @@ echo "Received sessionId: $sessionId"
# Step 2: Poll the status endpoint every 2 seconds
while true; do
status_response=$(curl -s http://localhost:9090/quiz/status/"$sessionId")
if [ $? -eq 0 ]; then
if [ "$status_response" != "null" ] && [ $? -eq 0 ]; then
statusCode=$(echo "$status_response" | grep -o '"statusCode":[0-9]*' | sed 's/"statusCode"://')
@@ -34,7 +32,6 @@ while true; do
# Check if the response is JSON (starts with '{')
if [[ $status_response == \{* ]]; then
# echo "$statusCode"
echo "$sessionId: done! status: $statusCode"
break
fi