processAccount($id); $lastId = $id; } if (function_exists('gc_collect_cycles')) { gc_collect_cycles(); } } return 0; } private function processAccount($id) { $acct = AccountService::get($id, true); if (! $acct) { AccountStatService::removeFromPostCount($id); return; } $statusCount = Status::whereProfileId($id)->count(); if ($statusCount != $acct['statuses_count']) { $profile = Profile::find($id); if (! $profile) { AccountStatService::removeFromPostCount($id); return; } $profile->status_count = $statusCount; $profile->save(); AccountService::del($id); } AccountStatService::removeFromPostCount($id); } }