I have an app in vapor and I have a long running job lets say UpdateSomething and I want this job to be on one queue only, I don't want it to run concurrently.
class UpdateSomething implements ShouldQueue
{
use Dispatchable;
use Batchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
public $tries = 30;
/**
* Create a new job instance.
*/
public function __construct()
{
}
public function middleware(): array
{
return [(new WithoutOverlapping(get_class($this)))->releaseAfter(1)];
}
So I have here 30 tries and each try will retry after 1 second.
Is this the right way to do this? Do I need to run expireAfter? What's the purpose of expireAfter?