chore: 暂存本地修改
This commit is contained in:
@@ -6,11 +6,27 @@ cd "$(dirname "$0")"
|
||||
|
||||
echo "使用 request/proxy_settings.json 读取代理配置"
|
||||
export PROXY_MAX_REQUESTS_PER_SECOND="${PROXY_MAX_REQUESTS_PER_SECOND:-5}"
|
||||
export PROXY_MAX_CONCURRENT_REQUESTS="${PROXY_MAX_CONCURRENT_REQUESTS:-5}"
|
||||
|
||||
is_job_running() {
|
||||
local script="$1"
|
||||
local script_regex="${script//./\\.}"
|
||||
pgrep -af "(^|[[:space:]/])${script_regex}([[:space:]]|$)" || true
|
||||
}
|
||||
|
||||
start_job() {
|
||||
local script="$1"
|
||||
local log_file="$2"
|
||||
local label="$3"
|
||||
local existing
|
||||
|
||||
existing="$(is_job_running "${script}")"
|
||||
if [[ -n "${existing}" ]]; then
|
||||
echo "跳过 ${label}: ${script} 已在运行"
|
||||
echo "${existing}" | head -n 1
|
||||
return 0
|
||||
fi
|
||||
|
||||
nohup python "../common_sites/${script}" > "${log_file}" 2>&1 &
|
||||
echo "启动 ${label}: ${script} -> ${log_file}"
|
||||
sleep 1
|
||||
|
||||
Reference in New Issue
Block a user