Yes, your approach is correct. You can start multiple workers for different queues on the same connection by specifying the queue name with the --queue option. This way, each worker will only process jobs from the specified queue.
Here is how you can start the workers for your uploads and scout queues:
sail artisan queue:work redis --queue=uploads
sail artisan queue:work redis --queue=scout
This will start two separate workers, one for the uploads queue and another for the scout queue, both using the redis connection.
Additionally, if you want to run these workers in the background, you can use a process manager like Supervisor to manage them. Here is an example Supervisor configuration for your workers:
[program:uploads_queue_worker]
process_name=%(program_name)s_%(process_num)02d
command=docker exec your_container_name sail artisan queue:work redis --queue=uploads --sleep=3 --tries=3
autostart=true
autorestart=true
numprocs=1
redirect_stderr=true
stdout_logfile=/path/to/your/logs/uploads_queue_worker.log
[program:scout_queue_worker]
process_name=%(program_name)s_%(process_num)02d
command=docker exec your_container_name sail artisan queue:work redis --queue=scout --sleep=3 --tries=3
autostart=true
autorestart=true
numprocs=1
redirect_stderr=true
stdout_logfile=/path/to/your/logs/scout_queue_worker.log
Replace your_container_name with the name of your Docker container running Laravel Sail, and adjust the stdout_logfile paths as needed.
This configuration will ensure that your workers are always running and will automatically restart if they fail.