Loop cron profile_ids akan gagal di 50+ akun — duplicate launch, browser yatim, tanpa retry. Pattern queue + worker pool dengan profile leasing menyelesaikan ini. Resep pakai Redis; bisa diganti SQS, RabbitMQ, atau PostgreSQL SKIP LOCKED.

Arsitektur

API / dashboard → LPUSH mlx:jobs
Worker pool     → BRPOP → lease profile → start → CDP job → stop → webhook
CMDB            → profile_id, tier, lease_until, ban_status

Schema job (JSON)

{
  "job_id": "uuid",
  "profile_id": "mlx-profile-uuid",
  "task": "sync_orders",
  "payload": {"shop_id": "acme_id"},
  "attempt": 1,
  "max_attempts": 3,
  "callback_url": "https://ops.example/hooks/mlx"
}

Lease profile

import redis

r = redis.Redis(decode_responses=True)
LEASE_TTL = 900  # 15 menit

def try_lease(profile_id: str, worker_id: str) -> bool:
    key = f"mlx:lease:{profile_id}"
    return r.set(key, worker_id, nx=True, ex=LEASE_TTL)

Webhook

Worker POST hasil ke callback_url. Receiver perlu verify HMAC dan dedupe job_id: webhook receiver (EN).

Aturan operasi

Detail lengkap: versi Inggris.

Terkaait

Pengungkapan: MLX-MMO afiliasi dengan Multilogin. Verifikasi endpoint API dengan dokumentasi resmi. 70+ panduan EN tersedia.