Files
finance/app/Console/Kernel.php
Ümit Tunç 0d6e449808 Refactor Console Kernel to include MergeCurrencyAndGoldRates job
- Added the MergeCurrencyAndGoldRates job to the Console Kernel, ensuring it is now part of the job dispatching process.
- This change improves the overall functionality of scheduled tasks related to currency and gold rates, enhancing data integration within the Truncgil Finance application.
2025-01-21 22:29:17 +03:00

55 lines
1.5 KiB
PHP
Raw Permalink 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;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\Jobs\FetchCurrencyRates;
use App\Jobs\FetchGoldRates;
use App\Jobs\FetchCryptoCurrencyRates;
use App\Jobs\MergeCurrencyAndGoldRates;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* These should be classes that implement the ShouldQueue interface.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->job(new FetchCurrencyRates())->everyMinute();
$schedule->job(new FetchGoldRates())->everyMinute();
$schedule->job(new FetchCryptoCurrencyRates())->everyMinute();
$schedule->job(new MergeCurrencyAndGoldRates())->everyMinute();
}
/**
* Register the commands for your application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
public function runScheduledCommands()
{
$schedule = app(Schedule::class);
$schedule->job(new FetchCurrencyRates())->everyMinute();
$schedule->job(new FetchGoldRates())->everyMinute();
$schedule->job(new FetchCryptoCurrencyRates())->everyMinute();
$schedule->job(new MergeCurrencyAndGoldRates())->everyMinute();
// Diğer job'larınızı buraya ekleyin
$schedule->run();
}
}