From a1d81a3244439912c517f240d21a06dbd53f3c4f Mon Sep 17 00:00:00 2001 From: cp6 Date: Thu, 13 Oct 2022 13:37:02 +1100 Subject: [PATCH] Updated cache timeframes Updated cache timeframes --- app/Models/Home.php | 8 ++++---- app/Models/IPs.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Models/Home.php b/app/Models/Home.php index 14e56fe..14380bf 100644 --- a/app/Models/Home.php +++ b/app/Models/Home.php @@ -25,7 +25,7 @@ class Home extends Model public static function servicesCount() { - return Cache::remember('services_count', now()->addHour(6), function () { + return Cache::remember('services_count', now()->addHours(6), function () { return DB::table('pricings') ->select('service_type', DB::raw('COUNT(*) as amount')) ->groupBy('service_type') @@ -36,7 +36,7 @@ class Home extends Model public static function dueSoonData() { - return Cache::remember('due_soon', now()->addHour(6), function () { + return Cache::remember('due_soon', now()->addHours(6), function () { return DB::table('pricings as p') ->leftJoin('servers as s', 'p.service_id', '=', 's.id') ->leftJoin('shared_hosting as sh', 'p.service_id', '=', 'sh.id') @@ -53,7 +53,7 @@ class Home extends Model public static function serverSummary() { - return Cache::remember('servers_summary', now()->addHour(6), function () { + return Cache::remember('servers_summary', now()->addHours(6), function () { $cpu_sum = DB::table('servers')->get()->where('active', '=', 1)->sum('cpu'); $ram_mb = DB::table('servers')->get()->where('active', '=', 1)->sum('ram_as_mb'); $disk_gb = DB::table('servers')->get()->where('active', '=', 1)->sum('disk_as_gb'); @@ -73,7 +73,7 @@ class Home extends Model public static function recentlyAdded() { - return Cache::remember('recently_added', now()->addHour(6), function () { + return Cache::remember('recently_added', now()->addHours(6), function () { return DB::table('pricings as p') ->leftJoin('servers as s', 'p.service_id', '=', 's.id') ->leftJoin('shared_hosting as sh', 'p.service_id', '=', 'sh.id') diff --git a/app/Models/IPs.php b/app/Models/IPs.php index 882c660..1dbb5eb 100644 --- a/app/Models/IPs.php +++ b/app/Models/IPs.php @@ -40,7 +40,7 @@ class IPs extends Model public static function ipsForServer(string $server_id) { - return Cache::remember("ip_addresses.$server_id", now()->addHour(1), function () use ($server_id) { + return Cache::remember("ip_addresses.$server_id", now()->addHours(1), function () use ($server_id) { return json_decode(DB::table('ips as i') ->where('i.service_id', '=', $server_id) ->get(), true);