Queue Commands Reference
Complete reference for all queue-related Artisan commands in the Volāre application.
Custom Commands
Section titled “Custom Commands”queue:test
Section titled “queue:test”Dispatch a test job to verify queue functionality.
./vendor/bin/sail artisan queue:testWhat it does:
- Dispatches a
TestQueueJobwith a test message - Confirms job was queued successfully
- Provides next steps for monitoring
queue:monitor
Section titled “queue:monitor”Display current queue status and pending jobs.
./vendor/bin/sail artisan queue:monitorExample Output:
Queue Status:Pending jobs: 5Failed jobs: 0Pro tip: Use with watch for live monitoring:
watch -n 2 './vendor/bin/sail artisan queue:monitor'Laravel Queue Commands
Section titled “Laravel Queue Commands”queue:work
Section titled “queue:work”Start processing jobs on the queue.
./vendor/bin/sail artisan queue:work [connection] [options]Important Options:
| Option | Description |
|---|---|
--queue= |
Queues to process (comma-separated, priority order) |
--once |
Process single job then exit |
--stop-when-empty |
Stop when queue is empty |
--sleep= |
Seconds to sleep when no jobs available (default: 3) |
--tries= |
Number of times to attempt a job (default: 1) |
--timeout= |
Maximum seconds a job should run (default: 60) |
--max-time= |
Maximum seconds worker should run |
--max-jobs= |
Maximum jobs to process before stopping |
--memory= |
Memory limit in MB (default: 128) |
Examples:
# Main worker (the `queue` service in compose.yaml) — queues in priority order./vendor/bin/sail artisan queue:work \ --queue=aerticket-tickets,aerticket-fastlane,aerticket-bookings,aerticket-voids,pipedrive-sync,offer-recalculations,default \ --sleep=3 --tries=3 --max-time=3600
# Process one job and exit./vendor/bin/sail artisan queue:work --onceWorker Layout
Section titled “Worker Layout”compose.yaml runs two dedicated workers so customer-facing flight searches
can’t be blocked by ticketing/booking work (and vice versa):
| Service | --queue= |
Handles |
|---|---|---|
queue |
aerticket-tickets,aerticket-fastlane,aerticket-bookings,aerticket-voids,pipedrive-sync,offer-recalculations,default |
Ticketing, bookings, voids, Pipedrive sync, offer recalculations |
queue-flights |
flight-searches |
SearchFlightCacheJob, CascadeFlightSearchForDateJob (customer-facing flight cache) |
The default queue connection is database (config/queue.php → QUEUE_CONNECTION).
Production note: the production
queue-workerECR image runs a single worker that mergesflight-searchesinto the main list (seebackend/docker/common/queue-worker/queue-worker.sh), sized byQUEUE_WORKER_MEMORY. The two-worker split above is the devcompose.yamllayout.
Source: backend/compose.yaml, backend/config/queue.php
queue:listen
Section titled “queue:listen”Listen to a queue and process jobs (with code reload).
./vendor/bin/sail artisan queue:listen [connection] [options]Difference from queue:work:
- Restarts framework on each job (slower but picks up code changes)
- No need to manually restart after code changes
- Not recommended for production
queue:restart
Section titled “queue:restart”Signal all queue workers to restart after current job.
./vendor/bin/sail artisan queue:restartWhen to use:
- After deploying code changes
- After config changes
- After dependency updates
queue:retry
Section titled “queue:retry”Retry failed jobs.
./vendor/bin/sail artisan queue:retry [id]Examples:
# Retry all failed jobs./vendor/bin/sail artisan queue:retry all
# Retry specific failed job./vendor/bin/sail artisan queue:retry 9e3e9e3e-9e3e-9e3e-9e3e-9e3e9e3e9e3e
# Retry jobs from specific queue./vendor/bin/sail artisan queue:retry all --queue=paymentsqueue:forget
Section titled “queue:forget”Delete a failed job.
./vendor/bin/sail artisan queue:forget [id]queue:flush
Section titled “queue:flush”Delete all failed jobs.
./vendor/bin/sail artisan queue:flushWarning: Use with caution in production!
queue:failed
Section titled “queue:failed”List all failed jobs.
./vendor/bin/sail artisan queue:failedGet detailed info:
./vendor/bin/sail artisan tinker>>> $failed = DB::table('failed_jobs')->latest()->first();>>> echo $failed->exception;queue:clear
Section titled “queue:clear”Delete all jobs from a queue.
./vendor/bin/sail artisan queue:clear database --queue=emailsqueue:prune-failed
Section titled “queue:prune-failed”Prune stale failed jobs.
# Prune jobs older than 24 hours (default)./vendor/bin/sail artisan queue:prune-failed
# Prune jobs older than 7 days./vendor/bin/sail artisan queue:prune-failed --hours=168queue:prune-batches
Section titled “queue:prune-batches”Prune stale batch records.
./vendor/bin/sail artisan queue:prune-batches --hours=720Common Workflows
Section titled “Common Workflows”Development Workflow
Section titled “Development Workflow”# 1. Start development environment./vendor/bin/sail up -d
# 2. Verify queue is working./vendor/bin/sail artisan queue:test
# 3. Monitor queue status./vendor/bin/sail artisan queue:monitor
# 4. Make code changes to your job
# 5. Restart workers to pick up changes./vendor/bin/sail artisan queue:restart
# 6. Test your job./vendor/bin/sail artisan tinker>>> YourJob::dispatch($args);
# 7. Watch logs./vendor/bin/sail artisan pailDebugging Failed Jobs
Section titled “Debugging Failed Jobs”# 1. List all failed jobs./vendor/bin/sail artisan queue:failed
# 2. Get detailed error information./vendor/bin/sail artisan tinker>>> $failed = DB::table('failed_jobs')->latest()->first();>>> echo $failed->exception;
# 3. Fix the underlying issue in code
# 4. Restart workers./vendor/bin/sail artisan queue:restart
# 5. Retry the failed job./vendor/bin/sail artisan queue:retry allProduction Deployment
Section titled “Production Deployment”Production does not deploy via git pull. Backend images are built and
pushed to ECR, then rolled out via the infra-volare workflow; queue workers
run as their own containers. New containers start fresh (running the entrypoint
optimizations), so there is no manual queue:restart step in a normal deploy.
See Deployment for the full pipeline.
Emergency Procedures
Section titled “Emergency Procedures”Queue is Stuck:
# 1. Check what's in the queue./vendor/bin/sail artisan queue:monitor
# 2. Check worker statusdocker ps | grep queue
# 3. Restart worker container./vendor/bin/sail restart queue
# 4. If still stuck, clear queue (CAUTION!)./vendor/bin/sail artisan queue:clear database --queue=defaultToo Many Failed Jobs:
# 1. Investigate cause./vendor/bin/sail artisan tinker>>> DB::table('failed_jobs')->latest()->first()->exception;
# 2. Fix underlying issue
# 3. Retry if fixable./vendor/bin/sail artisan queue:retry all
# 4. Or flush if not recoverable./vendor/bin/sail artisan queue:flushQuick Reference Card
Section titled “Quick Reference Card”# Testing & Monitoringqueue:test # Dispatch test jobqueue:monitor # Show queue statusqueue:failed # List failed jobs
# Worker Managementqueue:work # Start processing (in Docker)queue:restart # Gracefully restart workers
# Failed Job Managementqueue:retry all # Retry all failed jobsqueue:retry {id} # Retry specific jobqueue:forget {id} # Delete failed jobqueue:flush # Delete all failed jobs
# Maintenancequeue:clear # Clear pending jobsqueue:prune-failed # Remove old failed jobsqueue:prune-batches # Remove old batch records
# Logging & Debuggingartisan pail # Follow Laravel logslogs queue # View worker logs (Sail)tinker # Interactive consoleRelated Documentation
Section titled “Related Documentation”- Queue System - Queue infrastructure
- Creating Jobs Guide - How to create queue jobs