mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
torrent bought user cache use hash + err() use warning message sometime
This commit is contained in:
51
app/Jobs/LoadTorrentBoughtUsers.php
Normal file
51
app/Jobs/LoadTorrentBoughtUsers.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Repositories\TorrentRepository;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class LoadTorrentBoughtUsers implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
private int $torrentId;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(int $torrentId)
|
||||
{
|
||||
$this->torrentId = $torrentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$rep = new TorrentRepository();
|
||||
$result = $rep->loadBoughtUser($this->torrentId);
|
||||
do_log("result: $result");
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a job failure.
|
||||
*
|
||||
* @param \Throwable $exception
|
||||
* @return void
|
||||
*/
|
||||
public function failed(\Throwable $exception)
|
||||
{
|
||||
do_log("failed: " . $exception->getMessage() . $exception->getTraceAsString(), 'error');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user