tokenbridge/oracle/scripts/start-worker.sh

18 lines
339 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -o pipefail
WORKERS_DIR="src/"
LOGS_DIR="logs/"
WORKER="${WORKERS_DIR}${1}.js"
CONFIG="${2}.config.js"
LOG="${LOGS_DIR}${2}.txt"
2021-07-07 16:21:01 +03:00
TX_HASH=${@:3}
if [ "${NODE_ENV}" = "production" ]; then
2021-07-08 09:38:55 +03:00
exec node "${WORKER}" "${CONFIG}" $TX_HASH
else
2021-07-08 09:38:55 +03:00
node "${WORKER}" "${CONFIG}" $TX_HASH | tee -a "${LOG}" | pino-pretty
fi