check_pid changes

This commit is contained in:
2024-12-20 10:49:16 +01:00
parent 73a6aeae51
commit fbdf365e6b
2 changed files with 14 additions and 6 deletions

View File

@@ -1,10 +1,17 @@
#!/bin/sh
PID="$1"
TASK="$2"
DATE="$3";
REDIS_SERVER="$4"
REDIS_PORT="$5"
SHARED="$2"
TASK="$3"
DATE="$4";
DEBUG="$5";
# writes debug message if DEBUG variable is set
debug() {
if [ $DEBUG -eq 1 ]; then
echo "DEBUG: "$1 $2 $3
fi
}
if [ "$PID" != "" ]; then
@@ -15,7 +22,8 @@ if [ "$PID" != "" ]; then
JSON_TARGET=$(echo '{ "DATE": "'$DATE'", "STATUS": "2" }' | jq -r . | base64 -w0)
debug "JSON_TARGET: $JSON_TARGET"
redis-cli -h $REDIS_SERVER -p $REDIS_PORT SET $TASK "$JSON_TARGET"
echo $JSON_TARGET | base64 -d >$SHARED/output/$TASK.json
#redis-cli -h $REDIS_SERVER -p $REDIS_PORT SET $TASK "$JSON_TARGET"
fi;

View File

@@ -741,7 +741,7 @@ execute_task() {
DEPLOY_PAYLOAD=$(echo "$JSON" | jq -r .PAYLOAD) # base64 list of key-value pairs in JSON
deploy_additionals "$APP_DIR" "$DEPLOY_NAME" "$DEPLOY_PAYLOAD"
sh /scripts/check_pid.sh "$PID" "$TASK" "$DATE" "$REDIS_SERVER" "$REDIS_PORT" &
sh /scripts/check_pid.sh "$PID" "$SHARED" "$TASK" "$DATE" "$DEBUG" &
fi
fi
done