chart handled

This commit is contained in:
2026-06-02 12:24:54 +03:30
parent 3e6c4b588d
commit 0f89a9c567
4 changed files with 219 additions and 8 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Console\Commands;
use App\Services\ZaarboxPriceService;
use Illuminate\Console\Command;
class RefreshZaarboxPrices extends Command
{
protected $signature = 'prices:refresh-zaarbox';
protected $description = 'Fetch gold price history from Zaarbox and store in cache';
public function handle(ZaarboxPriceService $zaarboxPriceService): int
{
$prices = $zaarboxPriceService->refreshCache();
$this->info(sprintf(
'Zaarbox prices cached: DAILY=%d, WEEKLY=%d, MONTHLY=%d',
count($prices['DAILY'] ?? []),
count($prices['WEEKLY'] ?? []),
count($prices['MONTHLY'] ?? []),
));
return self::SUCCESS;
}
}
+5
View File
@@ -34,6 +34,11 @@ class Kernel extends ConsoleKernel
}
}
})->everyMinute()->name('update_products_every_20s')->withoutOverlapping();
$schedule->command('prices:refresh-zaarbox')
->everyThirtyMinutes()
->name('refresh_zaarbox_prices')
->withoutOverlapping();
}
/**