Queue System
QueueProcessor
Static methods:
processQueue(batchSize) — process queued + retry failed posts
processEvergreen() — re-share evergreen articles on schedule
retryPosts(postIds) — manually re-queue failed posts
retryService(serviceId) — bulk retry all failed for a service
hasPendingWork() — check if queue has items
Retry Mechanism
- Failed posts auto-retry up to
retry_max times (default 3)
- Exponential backoff:
retry_delay * 2^retry_count seconds
- After max retries: status set to
permanently_failed
- Manual retry resets status to
queued and retry_count to 0
Post Statuses
queued, posting, posted, failed, permanently_failed, cancelled, scheduled
Concurrency
Uses MySQL advisory lock (GET_LOCK) to prevent concurrent processing.