getAuthModel()->db->transBegin(); try { $entitys = $this->getAuthModel()->asObject(AuthEntity::class)->where(['status' => 'use'])->findAll(); foreach ($entitys as $entity) { $api = new \App\Libraries\Cloudflare\API\Account($entity); $api->reload(); } //transation 완료 // $this->getAuthModel()->db->transCommit(); Log::add("error", __METHOD__ . "에서 Account Reload 완료"); } catch (\Exception $e) { //transaction 오류복구 // $this->getAuthModel()->db->transRollback(); Log::add("error", __METHOD__ . "에서 Account Reload 오류\n" . $e->getMessage()); } } }