Commit 3e01d114 authored by Dominika Liberda's avatar Dominika Liberda 💽

+ some logs for workers [WRKR]

parent e84efbc9
secret/*
app
......@@ -46,14 +46,14 @@ LauraIsCute
exit 0
fi
echo "HTTP.sh"
source src/worker.sh
if [[ -f "${cfg[namespace]}/config.sh" ]]; then
source "${cfg[namespace]}/config.sh"
fi
echo "HTTP.sh"
if [[ ${cfg[http]} == true ]]; then
echo "[HTTP] listening on ${cfg[ip]}:${cfg[port]}"
ncat -v -l ${cfg[ip]} ${cfg[port]} -c ./src/server.sh -k 2>> /dev/null &
......
......@@ -5,6 +5,7 @@
# worker_add(name, interval)
function worker_add() {
if [[ -x "${cfg[namespace]}/workers/$1/worker.sh" ]]; then
echo "[WRKR] adding worker $1"
while true; do
source "${cfg[namespace]}/workers/$1/worker.sh"
sleep $2
......@@ -20,7 +21,7 @@ function worker_add() {
fi
done &
else
echo "You have a broken worker configuration! Please check if worker.sh in worker $1 is executable."
echo "[WRKR] Broken config - workers/$1/worker.sh does not exist, or is not executable?"
fi
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment