mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
improve claim + horizon instead queue:work
This commit is contained in:
34
app/Jobs/SettleClaim.php
Normal file
34
app/Jobs/SettleClaim.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Repositories\ClaimRepository;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
|
||||
class SettleClaim implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct(public int $userId)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public $timeout = 600;
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$userId = $this->userId;
|
||||
$logMsg = "userId: $userId";
|
||||
$rep = new ClaimRepository();
|
||||
$result = $rep->settleUser($userId, false, false, true);
|
||||
do_log("$logMsg, result: " . var_export($result, true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user