Skip to content

Commit

Permalink
Merge pull request #130 from fortrabbit/fix/deploy-hook-timeout
Browse files Browse the repository at this point in the history
Increase timeout
  • Loading branch information
Oliver Stark authored Feb 7, 2022
2 parents da606cd + 35f7908 commit 2bd753d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.1.1 - 2022-02-07
- Increased timeout (300s) for before/after deploy scripts eventually

## 1.1.0 - 2022-01-18
- Added support for Craft Nitro [see README.md](https://github.com/fortrabbit/craft-copy#craft-nitro-support)
- Dropped PHP 7.2 support
Expand Down
2 changes: 2 additions & 0 deletions src/Helpers/DeployHooksHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace fortrabbit\Copy\Helpers;

use fortrabbit\Copy\Plugin;
use Symfony\Component\Process\Process;

trait DeployHooksHelper
Expand Down Expand Up @@ -45,6 +46,7 @@ protected function runDeployCommands(string $when): bool
foreach ($scripts as $script) {
$this->cmdBlock($script);
$process = Process::fromShellCommandline($script);
$process->setTimeout(Plugin::DEPLOY_HOOK_TIMEOUT);
$process->run();
if (! $process->isSuccessful()) {
$this->errorBlock($process->getErrorOutput());
Expand Down
2 changes: 2 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class Plugin extends BasePlugin
{
public const DASHBOARD_URL = 'https://dashboard.fortrabbit.com';

public const DEPLOY_HOOK_TIMEOUT = 300;

public const ENV_DEFAULT_STAGE = 'DEFAULT_STAGE';

public const PLUGIN_ROOT_PATH = __DIR__;
Expand Down

0 comments on commit 2bd753d

Please sign in to comment.