Continue to show all common addresses in Items Waiting tab, Add Address Clear Queue job to delete anything in the queue for an address
This commit is contained in:
42
app/Console/Commands/AddressClearQueue.php
Normal file
42
app/Console/Commands/AddressClearQueue.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
use App\Jobs\AddressClearQueue as Job;
|
||||
use App\Models\Address;
|
||||
|
||||
class AddressClearQueue extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'address:clear:queue'
|
||||
.' {ftn : FTN}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Clear up anything queued for an FTN';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
$ao = Address::findFTN($this->argument('ftn'),TRUE,TRUE);
|
||||
|
||||
if (! $ao) {
|
||||
$this->error('FTN not found: '.$this->argument('ftn'));
|
||||
|
||||
return self::FAILURE;
|
||||
}
|
||||
|
||||
return Job::dispatchSync($ao);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user