flyzto hai 1 semana
pai
achega
6f07b6ca9e
Modificáronse 1 ficheiros con 4 adicións e 7 borrados
  1. 4 7
      server/models/Control.js

+ 4 - 7
server/models/Control.js

@@ -116,13 +116,10 @@ const clearCache = (cachePath) => {
  * 清除缓存并重启服务
  */
 const pm2RestartClearCache = async (serviceName, cachePath) => {
-  return pm2Stop(serviceName)
-  .then(() => {
-    return clearCache(cachePath);
-  })
-  .then(() => {
-    return pm2Start(serviceName);
-  });
+  const stopResult = await pm2Stop(serviceName);
+  const clearResult = await clearCache(cachePath);
+  const startResult = await pm2Start(serviceName);
+  return [stopResult, clearResult, startResult].join('\n\n\n====================\n\n\n');
 }
 
 /**