chart handled
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user