mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
cleanp add delay option
This commit is contained in:
@@ -14,14 +14,14 @@ class Cleanup extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'cleanup {--action=} {--begin_id=} {--end_id=} {--request_id=}';
|
||||
protected $signature = 'cleanup {--action=} {--begin_id=} {--end_id=} {--request_id=} {--delay=}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Cleanup async job trigger, options: --begin_id, --end_id, --request_id, --action (seed_bonus, seeding_leeching_time, seeders_etc)';
|
||||
protected $description = 'Cleanup async job trigger, options: --begin_id, --end_id, --request_id, --delay, --action (seed_bonus, seeding_leeching_time, seeders_etc)';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
@@ -34,13 +34,14 @@ class Cleanup extends Command
|
||||
$beginId = $this->option('begin_id');
|
||||
$endId = $this->option('end_id');
|
||||
$commentRequestId = $this->option('request_id');
|
||||
$this->info("beginId: $beginId, endId: $endId, commentRequestId: $commentRequestId, action: $action");
|
||||
$delay = $this->option('delay') ?: 0;
|
||||
$this->info("beginId: $beginId, endId: $endId, commentRequestId: $commentRequestId, delay: $delay, action: $action");
|
||||
if ($action == 'seed_bonus') {
|
||||
CalculateUserSeedBonus::dispatch($beginId, $endId, $commentRequestId);
|
||||
CalculateUserSeedBonus::dispatch($beginId, $endId, $commentRequestId)->delay($delay);
|
||||
} elseif ($action == 'seeding_leeching_time') {
|
||||
UpdateUserSeedingLeechingTime::dispatch($beginId, $endId, $commentRequestId);
|
||||
UpdateUserSeedingLeechingTime::dispatch($beginId, $endId, $commentRequestId)->delay($delay);
|
||||
}elseif ($action == 'seeders_etc') {
|
||||
UpdateTorrentSeedersEtc::dispatch($beginId, $endId, $commentRequestId);
|
||||
UpdateTorrentSeedersEtc::dispatch($beginId, $endId, $commentRequestId)->delay($delay);
|
||||
} else {
|
||||
$msg = "[$commentRequestId], Invalid action: $action";
|
||||
do_log($msg, 'error');
|
||||
|
||||
Reference in New Issue
Block a user