Просмотр исходного кода

do not autorebbot after pwchange if isRebootVmAfterChangePackage is disabled

andre 4 лет назад
Родитель
Сommit
74f08f5f4f
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      app/Http/Actions/ChangePassword.php

+ 3 - 1
app/Http/Actions/ChangePassword.php

@@ -59,7 +59,9 @@ class ChangePassword extends AddonController
                 $container['cipassword'] = $params['password'];
                 $this->vm()->updateConfig($container);
                 //restart
-                if (!Job::waiting()->ofJob(RebootVmJob::class)->ofHostingId($this->getWhmcsParamByKey("serviceid"))->count())
+                if ($this->configuration()->isRebootVmAfterChangePackage() &&
+                    $this->vm()->isRunning() &&
+                    !Job::waiting()->ofJob(RebootVmJob::class)->ofHostingId($this->getWhmcsParamByKey("serviceid"))->count())
                 {
                     queue(RebootVmJob::class, [], null, "hosting", $this->getWhmcsParamByKey("serviceid"));
                 }