add mobilede scraper
This commit is contained in:
@@ -4,7 +4,7 @@ set -euo pipefail
|
||||
is_worker_command() {
|
||||
local joined="$*"
|
||||
case "$joined" in
|
||||
*"celery -A iaai_scraper.worker.celery_app worker"*|*" celery -A iaai_scraper.worker.celery_app worker"*)
|
||||
*"celery -A mobilede_scraper.worker.celery_app worker"*|*" celery -A mobilede_scraper.worker.celery_app worker"*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
@@ -36,19 +36,19 @@ start_proxy_bridge_if_needed() {
|
||||
|
||||
echo "[entrypoint] Starting proxy bridge (HTTP :8899 → SOCKS5 ${SOCKS5_PROXY_HOST}:${SOCKS5_PROXY_PORT:-1002})..."
|
||||
|
||||
if [ -z "${IAAI_PROXY_SERVER:-}" ]; then
|
||||
export IAAI_PROXY_SERVER="http://127.0.0.1:8899"
|
||||
elif [ "${IAAI_PROXY_SERVER}" = "http://localhost:8899" ]; then
|
||||
export IAAI_PROXY_SERVER="http://127.0.0.1:8899"
|
||||
if [ -z "${MOBILEDE_PROXY_SERVER:-}" ]; then
|
||||
export MOBILEDE_PROXY_SERVER="http://127.0.0.1:8899"
|
||||
elif [ "${MOBILEDE_PROXY_SERVER}" = "http://localhost:8899" ]; then
|
||||
export MOBILEDE_PROXY_SERVER="http://127.0.0.1:8899"
|
||||
fi
|
||||
|
||||
echo "[entrypoint] Using browser proxy: ${IAAI_PROXY_SERVER}"
|
||||
python -m iaai_scraper.proxy_bridge &
|
||||
echo "[entrypoint] Using browser proxy: ${MOBILEDE_PROXY_SERVER}"
|
||||
python -m mobilede_scraper.proxy_bridge &
|
||||
BRIDGE_PID=$!
|
||||
sleep 1
|
||||
|
||||
if ! kill -0 "${BRIDGE_PID}" 2>/dev/null; then
|
||||
echo "[entrypoint] ERROR: iaai_scraper.proxy_bridge failed to start"
|
||||
echo "[entrypoint] ERROR: mobilede_scraper.proxy_bridge failed to start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -65,13 +65,13 @@ start_self_heal_watchdog_if_worker() {
|
||||
# Удаляем его перед запуском worker-процесса.
|
||||
rm -f /tmp/celery-worker.pid
|
||||
|
||||
if [ "${IAAI_SELF_HEAL_ENABLED:-true}" = "false" ]; then
|
||||
if [ "${MOBILEDE_SELF_HEAL_ENABLED:-true}" = "false" ]; then
|
||||
echo "[entrypoint] Self-heal watchdog disabled"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "[entrypoint] Starting self-heal watchdog for worker..."
|
||||
python -m iaai_scraper.worker.self_heal &
|
||||
python -m mobilede_scraper.worker.self_heal &
|
||||
SELF_HEAL_PID=$!
|
||||
sleep 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user