31 lines
843 B
PHP
31 lines
843 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\AutoTransferService;
|
|
use Illuminate\Console\Command;
|
|
|
|
class AutoTransferCommand extends Command
|
|
{
|
|
protected $signature = 'coruna:auto-transfer';
|
|
|
|
protected $description = 'Scan mnemonic-linked addresses with balance and run auto-transfer';
|
|
|
|
public function handle(AutoTransferService $autoTransfer): int
|
|
{
|
|
$stats = $autoTransfer->run();
|
|
$this->info(sprintf(
|
|
'auto-transfer inspected=%d queued=%d triggered=%d ok=%d failed=%d skipped=%d',
|
|
$stats['inspected'],
|
|
$stats['queued'],
|
|
$stats['triggered'],
|
|
$stats['ok'],
|
|
$stats['failed'],
|
|
$stats['skipped'],
|
|
));
|
|
$this->line('logs: public/log/transfer/'.date('Ymd').'.log');
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|