合并应用宝 Worker 容器

This commit is contained in:
yml2213
2026-08-12 17:59:26 +08:00
parent cebbd94ae8
commit 1a20c367db
15 changed files with 155 additions and 110 deletions
@@ -14,6 +14,7 @@ import json
import os
import re
import subprocess
import sys
import threading
import time
import uuid
@@ -96,7 +97,7 @@ def _start_login(job_id: str, provider: str, timeout: int) -> None:
directory = _job_dir(job_id)
session = directory / "mall-session.json"
qr = directory / ("qq-login.jpg" if provider == "qq" else "wechat-login.jpg")
command = ["python3", f"scripts/login-{provider}.py", "--session", str(session),
command = [sys.executable, f"scripts/login-{provider}.py", "--session", str(session),
"--qr", str(qr), "--timeout", str(timeout)]
with _lock:
job["provider"] = provider
@@ -135,7 +136,7 @@ def _start_payment(job_id: str, selection: dict) -> None:
session = directory / "mall-session.json"
response = directory / "mall-order-response.json"
output = directory / "jsdom-order"
command = ["python3", "main.py", "mall", "auto", "--session", str(session),
command = [sys.executable, "main.py", "mall", "auto", "--session", str(session),
"--order-template", str(ROOT / "config" / "mall-order-template.json"),
"--quantity", "1", "--product-id", str(selection["product_id"]),
"--offer-id", str(selection["offer_id"]),
@@ -149,7 +150,7 @@ def _start_payment(job_id: str, selection: dict) -> None:
job = _jobs[job_id]
if job.get("status") != "success" or not response.exists():
return
pay_command = ["python3", "scripts/jsdom-pay.py", "--session", str(session),
pay_command = [sys.executable, "scripts/jsdom-pay.py", "--session", str(session),
"--mall-response", str(response), "--out-dir", str(output),
"--zone-id", str(selection["zone_id"]),
"--pf", str(selection.get("order_pf", "")),