Skip to content

Commit

Permalink
[3.x] Fix for some functions using a hard coded timeout of 30 (#157)
Browse files Browse the repository at this point in the history
* Update ManagesCertificates.php

* Update ManagesDaemons.php

* Update ManagesWorkers.php
  • Loading branch information
lhelwingkh authored Jul 7, 2023
1 parent 917ae15 commit a14bd4b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Actions/ManagesCertificates.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function installCertificate($serverId, $siteId, $certificateId, array $da
$this->post("servers/$serverId/sites/$siteId/certificates/$certificateId/install", $data);

if ($wait) {
$this->retry(30, function () use ($serverId, $siteId, $certificateId) {
$this->retry($this->getTimeout(), function () use ($serverId, $siteId, $certificateId) {
$certificate = $this->certificate($serverId, $siteId, $certificateId);

return $certificate->status == 'installed';
Expand All @@ -125,7 +125,7 @@ public function activateCertificate($serverId, $siteId, $certificateId, $wait =
$this->post("servers/$serverId/sites/$siteId/certificates/$certificateId/activate");

if ($wait) {
$this->retry(30, function () use ($serverId, $siteId, $certificateId) {
$this->retry($this->getTimeout(), function () use ($serverId, $siteId, $certificateId) {
$certificate = $this->certificate($serverId, $siteId, $certificateId);

return $certificate->activationStatus == 'activated';
Expand Down
2 changes: 1 addition & 1 deletion src/Actions/ManagesDaemons.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function restartDaemon($serverId, $daemonId, $wait = true)
$this->post("servers/$serverId/daemons/$daemonId/restart");

if ($wait) {
$this->retry(30, function () use ($serverId, $daemonId) {
$this->retry($this->getTimeout(), function () use ($serverId, $daemonId) {
$daemon = $this->daemon($serverId, $daemonId);

return $daemon->status == 'installed';
Expand Down
2 changes: 1 addition & 1 deletion src/Actions/ManagesWorkers.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function restartWorker($serverId, $siteId, $workerId, $wait = true)
$this->post("servers/$serverId/sites/$siteId/workers/$workerId/restart");

if ($wait) {
$this->retry(30, function () use ($serverId, $siteId, $workerId) {
$this->retry($this->getTimeout(), function () use ($serverId, $siteId, $workerId) {
$key = $this->worker($serverId, $siteId, $workerId);

return $key->status == 'installed';
Expand Down

0 comments on commit a14bd4b

Please sign in to comment.