mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 23:54:44 +02:00
Don't allow NodeStatisticsJob to be in the queue multiple times (#664)
* Make job unique * Pint fix
This commit is contained in:
parent
ecb195b2c4
commit
1df3e8d5b0
@ -4,26 +4,16 @@ namespace App\Jobs;
|
|||||||
|
|
||||||
use App\Models\Node;
|
use App\Models\Node;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
class NodeStatistics implements ShouldQueue
|
class NodeStatistics implements ShouldBeUnique, ShouldQueue
|
||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new job instance.
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the job.
|
|
||||||
*/
|
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
foreach (Node::all() as $node) {
|
foreach (Node::all() as $node) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user