Files
finance/app/Console/Commands/RunAllFetchs.php
T
Ümit Tunç 09e981f94b Implement crypto currency rates feature and enhance API responses
- Added a new job to fetch crypto currency rates from an external source and store them in a JSON file.
- Updated the CurrencyController to include methods for retrieving current crypto currency rates and rates by name.
- Enhanced the API to return detailed metadata for crypto currency rates, including timestamps and update information.
- Updated the API routes to support new endpoints for crypto currency rates.
- Modified the merged rates JSON to include crypto currency data alongside existing currency and gold rates.
- Improved the welcome view to display additional crypto currency information, enhancing user experience.

These changes collectively expand the functionality of the Truncgil Finance application, providing users with comprehensive access to crypto currency data.
2025-01-21 19:27:03 +03:00

60 lines
1.6 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;
use App\Jobs\FetchCryptoCurrencyRates;
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);
FetchCryptoCurrencyRates::dispatchSync();
$duration = microtime(true) - $start;
$results[] = ['FetchCryptoCurrencyRates', 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);
}
}