adjust(); } } public function adjust() { Account::query()->cursor()->each(function ($account) { nlog("resetting email quota for {$account->key}"); $email_count = Cache::get($account->key); if($email_count > 0){ try{ LightLogs::create(new EmailCount($email_count, $account->key))->send(); } catch(\Exception $e){ nlog($e->getMessage()); } } Cache::forget($account->key); Cache::forget("throttle_notified:{$account->key}"); }); } }