Reconnection

If the connection drops before receiving a result or error event, reconnect using the last received id as the last_id parameter:

GET /api/v1/scan-url?url=https://seranking.com&lang=en&last_id=1775848028596-0

This ensures you receive events that were emitted after the last successfully processed message.

Reconnection strategy:

  1. Store the latest id from any progress event

  2. On disconnect, wait with exponential backoff (1s, 2s, 4s, max 16s)

  3. Reconnect with last_id=<stored_id>

  4. Retry up to 5 times, then fail

Last updated