2019-05-06 14:12:53 +03:00
|
|
|
#!/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"
|
2020-05-21 20:23:00 +03:00
|
|
|
TX_HASH="${3}"
|
2019-05-06 14:12:53 +03:00
|
|
|
|
|
|
|
CHECKS=$(node scripts/initialChecks.js)
|
|
|
|
|
|
|
|
if [ "${NODE_ENV}" = "production" ]; then
|
2020-05-21 20:23:00 +03:00
|
|
|
exec node "${WORKER}" "${CONFIG}" "$CHECKS" "$TX_HASH"
|
2019-05-06 14:12:53 +03:00
|
|
|
else
|
2020-05-21 20:23:00 +03:00
|
|
|
node "${WORKER}" "${CONFIG}" "$CHECKS" "$TX_HASH" | tee -a "${LOG}" | pino-pretty
|
2019-05-06 14:12:53 +03:00
|
|
|
fi
|