Files
finance/app/Console/Commands/RunAllFetchs.php
T
Ümit Tunç 677da3892d Update RunAllFetchs command description for clarity
- 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.
2025-01-20 23:47:17 +03:00

54 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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);
}
}