Fetch the repository succeeded.
This action will force synchronization from 爱生活,爱JAVA/judeg0-api, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
#!/bin/bash
# Script for running Judge0 API workers.
#
# Usage: ./scripts/workers
#
source ./scripts/load-config
run_resque=1
resque_pid=0
date_now() {
echo -n $(date +"%Y-%m-%d-%H-%M-%S")
}
exit_gracefully() {
echo "[$(date_now)] Killing workers."
run_resque=0
kill -SIGQUIT $(pgrep -P $resque_pid)
kill -SIGTERM $resque_pid
}
trap exit_gracefully SIGTERM SIGINT
mkdir -p tmp/pids &> /dev/null
while [[ $run_resque -eq 1 ]]; do
rm -rf tmp/pids/resque.pid &> /dev/null
echo "[$(date_now)] Starting workers."
rails resque:workers &
resque_pid=$!
while ps -p $resque_pid > /dev/null; do sleep 1s; done
echo "[$(date_now)] Workers are stopped."
done
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。