xielin 6 years ago
parent
commit
e279af5cb8
1 changed files with 5 additions and 4 deletions
  1. 5 4
      app/Console/Commands/apollo.php

+ 5 - 4
app/Console/Commands/apollo.php

@@ -44,7 +44,7 @@ class Apollo extends Command
             config('apollo.namespaces')
             config('apollo.namespaces')
         );
         );
         $this->apollo->save_dir = $this->save_dir;
         $this->apollo->save_dir = $this->save_dir;
-        if(!is_dir($this->save_dir)){
+        if (!is_dir($this->save_dir)) {
             mkdir($this->save_dir);
             mkdir($this->save_dir);
         }
         }
     }
     }
@@ -72,14 +72,15 @@ class Apollo extends Command
                     Log::error('Load Apollo Config Failed, no config available');
                     Log::error('Load Apollo Config Failed, no config available');
                 }
                 }
                 $tpl = file_get_contents($this->config_tpl);
                 $tpl = file_get_contents($this->config_tpl);
-                foreach ($apollo as $key =>$value){
-                    $tpl = str_replace('{'.$key.'}',$value,$tpl);
+                foreach ($apollo as $key => $value) {
+                    $tpl = str_replace('{' . $key . '}', $value, $tpl);
                 }
                 }
-                file_put_contents($this->config_file,$tpl);
+                file_put_contents($this->config_file, $tpl);
             }); //此处传入回调
             }); //此处传入回调
             if ($error) {
             if ($error) {
                 Log::info("Apollo Hand error :" . $error);
                 Log::info("Apollo Hand error :" . $error);
             }
             }
+            sleep(60);
         } while ($error && $restart);
         } while ($error && $restart);
     }
     }
 }
 }