cfmgrv4 init...3

This commit is contained in:
최준흠 2024-10-22 15:22:25 +09:00
parent dfdaa1781e
commit 4a4361bb81
4 changed files with 10 additions and 3 deletions

View File

@ -46,7 +46,7 @@ class CloudflareSocket extends MySocket
log_message('warning', sprintf("--Cloudflare API Call %s초 대기 종료--", self::$_request_timewait)); log_message('warning', sprintf("--Cloudflare API Call %s초 대기 종료--", self::$_request_timewait));
} }
self::$_request++; self::$_request++;
log_message("debug", "현재 [" . self::$_request . "]:{$uri}"); // log_message("debug", "현재 [" . self::$_request . "]:{$uri}");
return parent::request($method, $uri, $options, $headers); return parent::request($method, $uri, $options, $headers);
} }
} }

View File

@ -166,7 +166,7 @@ abstract class CommonModel extends Model
if (!$this->save($entity)) { if (!$this->save($entity)) {
throw new \Exception("저장오류:" . var_export($this->errors(), true)); throw new \Exception("저장오류:" . var_export($this->errors(), true));
} }
log_message("debug", $this->getTable() . " => " . __FUNCTION__ . " DB에 {$entity->getTitle()} 저장이 완료되었습니다."); // log_message("debug", $this->getTable() . " => " . __FUNCTION__ . " DB에 {$entity->getTitle()} 저장이 완료되었습니다.");
return $entity; return $entity;
} catch (\Exception $e) { } catch (\Exception $e) {
$message = sprintf( $message = sprintf(

View File

@ -64,6 +64,7 @@ abstract class Cloudflare
// log_message("debug", var_export($body, true)); // log_message("debug", var_export($body, true));
$per_page = $body->result_info->per_page; $per_page = $body->result_info->per_page;
$total_page = $body->result_info->total_pages; $total_page = $body->result_info->total_pages;
$total_count = $body->result_info->total_count;
$results = [$body->result]; $results = [$body->result];
for ($i = $page + 1; $i <= $total_page; $i++) { for ($i = $page + 1; $i <= $total_page; $i++) {
// API 제한을 고려한 지연 추가 // API 제한을 고려한 지연 추가
@ -77,7 +78,12 @@ abstract class Cloudflare
array_push($results, $body->result); array_push($results, $body->result);
} }
} }
log_message("notice", "현재: page[{$i}/{$total_page}] , result수[" . count($results) . "]"); log_message("notice", sprintf(
"현재: page[%s/%s] , total_count:[%s] , results:[%s]",
$i,
$total_count,
count($results)
));
} }
return $results; return $results;
} }

View File

@ -160,6 +160,7 @@ class Zone extends Cloudflare
$formDatas = $this->getCFSetting($formDatas[ZoneModel::PK], $formDatas); $formDatas = $this->getCFSetting($formDatas[ZoneModel::PK], $formDatas);
$entitys[$formDatas[ZoneModel::PK]] = $this->getModel()->modify(new ZoneEntity(), $formDatas); $entitys[$formDatas[ZoneModel::PK]] = $this->getModel()->modify(new ZoneEntity(), $formDatas);
} }
log_message("debug", "현재 [" . $this->getMySocket()::$_request . "]");
} }
//부모키를 기준으로 CF에 존재하지 않는 데이터 삭제용 //부모키를 기준으로 CF에 존재하지 않는 데이터 삭제용
$this->getModel()->where(ZoneModel::PARENT, value: $this->getParentEntity()->getPK()); $this->getModel()->where(ZoneModel::PARENT, value: $this->getParentEntity()->getPK());