改名
This commit is contained in:
@@ -97,6 +97,7 @@ class Server extends Application
|
|||||||
return $this->error_stop($config['host'], $config['port']);
|
return $this->error_stop($config['host'], $config['port']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Snowflake::clearWorkerId();
|
||||||
$baseServer = $this->initCore($configs);
|
$baseServer = $this->initCore($configs);
|
||||||
$baseServer->start();
|
$baseServer->start();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,6 +141,18 @@ class Snowflake
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static function clearWorkerId()
|
||||||
|
{
|
||||||
|
$dir = storage(null, 'worker');
|
||||||
|
foreach (glob($dir . '/*') as $file) {
|
||||||
|
@unlink($file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $fileName
|
* @param $fileName
|
||||||
* @param $content
|
* @param $content
|
||||||
|
|||||||
@@ -164,6 +164,9 @@ if (!function_exists('storage')) {
|
|||||||
} else {
|
} else {
|
||||||
$fileName = rtrim(initDir($basePath, $path)) . '/' . $fileName;
|
$fileName = rtrim(initDir($basePath, $path)) . '/' . $fileName;
|
||||||
}
|
}
|
||||||
|
if (empty($fileName)) {
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
if (!file_exists($fileName)) {
|
if (!file_exists($fileName)) {
|
||||||
touch($fileName);
|
touch($fileName);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user