From 4b57077d9fbc027f05baba9bed8594f01654a353 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Sat, 29 Oct 2022 11:24:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Jobs/HostCost.php | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/app/Jobs/HostCost.php b/app/Jobs/HostCost.php index d56c364..6e740f8 100644 --- a/app/Jobs/HostCost.php +++ b/app/Jobs/HostCost.php @@ -35,39 +35,9 @@ public function handle() // $this->cache = new Cache(); // chunk hosts and load user - Host::active()->with('user')->chunk(100, function ($hosts) { + Host::active()->with('user')->chunk(1000, function ($hosts) { foreach ($hosts as $host) { - $host->cost(); - - // $this->cache_key = 'user_' . $host->user_id; - - // // if cache has user - - // if ($this->cache->has($this->cache_key)) { - // // if user is not instances of Model - // $user = $this->cache->get($this->cache_key); - - // if ($user instanceof User) { - // $this->user = $user; - // } else { - // $this->user = $this->cache->put($this->cache_key, $host->user, now()->addDay()); - // } - // } else { - // $this->user = $this->cache->put($this->cache_key, $host->user, now()->addDay()); - // } - - // // Log::debug($user); - - // if ($host->managed_price) { - // $host->price = $host->managed_price; - // } - - - // $this->user->drops -= $host->price; - - // // update cache - // $this->cache->put($this->cache_key, $this->user, now()->addDay()); } }); }