khanegi setting and prices records
This commit is contained in:
@@ -20,7 +20,7 @@ class ZaarboxPriceService
|
||||
private const CACHE_TTL_MINUTES = 35;
|
||||
|
||||
/** TTL کش فید — کران هر ۳۰ث refresh میکند؛ list فقط از همین میخواند */
|
||||
private const PRICE_LIST_CACHE_SECONDS = 45;
|
||||
private const PRICE_LIST_CACHE_SECONDS = 15;
|
||||
|
||||
private const DEFAULT_HISTORY_ID = 'ca3800a0-1f57-3528-b963-178f9168e04f';
|
||||
|
||||
@@ -90,6 +90,13 @@ class ZaarboxPriceService
|
||||
*/
|
||||
public function getAllPrices(): array
|
||||
{
|
||||
if ($this->config->getBool('chart_use_local_data', false)) {
|
||||
$local = app(PriceSnapshotService::class)->chartFromDatabase();
|
||||
if (! empty($local['DAILY'])) {
|
||||
return $local;
|
||||
}
|
||||
}
|
||||
|
||||
$cached = Cache::get($this->cacheKey());
|
||||
|
||||
if (is_array($cached) && isset($cached['prices'])) {
|
||||
|
||||
Reference in New Issue
Block a user