+ some logs for workers [WRKR]
parent
e84efbc9b0
commit
3e01d1147e
|
@ -0,0 +1,2 @@
|
|||
secret/*
|
||||
app
|
4
http.sh
4
http.sh
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue