fix:remove tagging from caches to enable dynamo db

This commit is contained in:
hackerESQ
2024-10-23 13:43:34 -05:00
parent 339de1ac9a
commit 2995f8b37e
5 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ class DashboardController extends Controller
$user = $request->user()->load(['portfolios', 'holdings', 'transactions']);
// get portfolio metrics
$metrics = cache()->tags(['metrics', 'dashboard', $user->id])->remember(
$metrics = cache()->remember(
'dashboard-metrics-' . $user->id,
10,
function () {
+1 -1
View File
@@ -29,7 +29,7 @@ class PortfolioController extends Controller
$portfolio->load(['transactions', 'holdings']);
// get portfolio metrics
$metrics = cache()->tags(['metrics', 'portfolio', $portfolio->id])->remember(
$metrics = cache()->remember(
'portfolio-metrics-' . $portfolio->id,
60,
function () use ($portfolio) {
@@ -20,8 +20,8 @@ class AlphaVantageMarketData implements MarketDataInterface
$quote = Alphavantage::core()->quoteEndpoint($symbol);
$quote = Arr::get($quote, 'Global Quote', []);
$fundamental = cache()->tags(['quote', 'alpha-vantage', $symbol])->remember(
'symbol-'.$symbol,
$fundamental = cache()->remember(
'av-symbol-'.$symbol,
1440,
function () use ($symbol) {
return Alphavantage::fundamentals()->overview($symbol);
@@ -30,8 +30,8 @@ class FinnhubMarketData implements MarketDataInterface
$quote = $this->client->quote($symbol);
$fundamental = cache()->tags(['quote', 'finnhub', $symbol])->remember(
'symbol-'.$symbol,
$fundamental = cache()->remember(
'fh-symbol-'.$symbol,
1440,
function () use ($symbol) {
return $this->client->companyBasicFinancials($symbol, "all");
+2 -2
View File
@@ -52,14 +52,14 @@ class Transaction extends Model
$transaction->refreshMarketData();
cache()->tags(['metrics', $transaction->portfolio_id])->flush();
cache()->forget('portfolio-metrics-' . $transaction->portfolio_id);
});
static::deleted(function ($transaction) {
$transaction->syncToHolding();
cache()->tags(['metrics', $transaction->portfolio_id])->flush();
cache()->forget('portfolio-metrics-' . $transaction->portfolio_id);
});
}