mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-07 16:40:56 +08:00
55 lines
1.3 KiB
PHP
55 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Repositories\HitAndRunRepository;
|
|
use Illuminate\Console\Command;
|
|
|
|
class HitAndRunUpdateStatus extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'hr:update_status {--uid=} {--torrent_id=} {--ignore_time=}';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Update H&R status, options: --uid, --torrent_id, --ignore_time';
|
|
|
|
/**
|
|
* Create a new command instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function handle()
|
|
{
|
|
$uid = $this->option('uid');
|
|
$torrentId = $this->option('torrent_id');
|
|
$ignoreTime = $this->option('ignore_time');
|
|
$rep = new HitAndRunRepository();
|
|
$rep->cronjobUpdateStatus($uid, $torrentId, $ignoreTime);
|
|
$log = sprintf(
|
|
'[%s], %s, uid: %s, torrentId: %s, ignoreTime: %s',
|
|
nexus()->getRequestId(), __METHOD__, $uid, $torrentId, $ignoreTime
|
|
);
|
|
$this->info($log);
|
|
do_log($log);
|
|
return 0;
|
|
}
|
|
}
|