Commit abb5d4a9 authored by Euan游根明's avatar Euan游根明

perf: 设置时区

parent b3e320c6
...@@ -13,6 +13,7 @@ class Nacos ...@@ -13,6 +13,7 @@ class Nacos
if (empty($res)){ if (empty($res)){
return; return;
} }
date_default_timezone_set('Asia/Shanghai');
self::info('开始拉取配置文件:'.date('Y-m-d H:i:s')); self::info('开始拉取配置文件:'.date('Y-m-d H:i:s'));
$url = self::$configs['NACOS_URL'] ?? ''; $url = self::$configs['NACOS_URL'] ?? '';
$group = self::$configs['GROUP'] ?? ''; $group = self::$configs['GROUP'] ?? '';
...@@ -259,13 +260,15 @@ class Nacos ...@@ -259,13 +260,15 @@ class Nacos
*/ */
public static function getPath($path,$fileName){ public static function getPath($path,$fileName){
$file = $path.$fileName; $filePath = $path.$fileName;
if (!file_exists($file)) { if (!file_exists($filePath)) {
mkdir($path, 0775, true); if (!file_exists($path)) {
touch($file); mkdir($path, 0775, true);
chmod($file, 0775); }
touch($filePath);
chmod($filePath, 0775);
} }
return $file; return $filePath;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment