677da3892d
- Changed the command description to provide a clearer understanding of its functionality, specifying that it runs all fetch jobs for currency and gold rates. This enhances documentation and usability for developers interacting with the command.
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
||
|
||
namespace App\Console\Commands;
|
||
|
||
use Illuminate\Console\Command;
|
||
use App\Jobs\FetchCurrencyRates;
|
||
use App\Jobs\FetchGoldRates;
|
||
use App\Jobs\MergeCurrencyAndGoldRates;
|
||
|
||
class RunAllFetchs extends Command
|
||
{
|
||
/**
|
||
* The name and signature of the console command.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $signature = 'run-all-fetchs';
|
||
|
||
/**
|
||
* The console command description.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected $description = 'This command runs all fetch jobs for currency and gold rates.';
|
||
|
||
/**
|
||
* Execute the console command.
|
||
*/
|
||
public function handle()
|
||
{
|
||
//
|
||
|
||
$results = [];
|
||
|
||
$start = microtime(true);
|
||
FetchCurrencyRates::dispatchSync();
|
||
$duration = microtime(true) - $start;
|
||
$results[] = ['FetchCurrencyRates', number_format($duration, 2)];
|
||
|
||
$start = microtime(true);
|
||
FetchGoldRates::dispatchSync();
|
||
$duration = microtime(true) - $start;
|
||
$results[] = ['FetchGoldRates', number_format($duration, 2)];
|
||
|
||
$start = microtime(true);
|
||
MergeCurrencyAndGoldRates::dispatchSync();
|
||
$duration = microtime(true) - $start;
|
||
$results[] = ['MergeCurrencyAndGoldRates', number_format($duration, 2)];
|
||
|
||
// Tablo formatında yazdırma
|
||
$this->table(['İşlem', 'Süre (saniye)'], $results);
|
||
}
|
||
}
|