Disabling default_timeout for run/runLocally has no effect
For disabling the timeout for run/runLocally default_timeout should be set to null: https://deployer.org/docs/7.x/recipe/common#default_timeout
Example:
<?php
namespace Deployer;
set('default_timeout', null);
localhost('test');
task('sleep5', function () {
run('sleep 5');
});
task('sleep10', function () {
run('sleep 10');
});
task('sleep500', function () {
run('sleep 500');
});
But dep sleep500 still quits at the default timeout of 300 seconds.
However, it looks like setting it to 0 instead of null is disabling the timeout: set('default_timeout', 0);
Occurrences: https://github.com/deployphp/deployer/blob/a14383ba5931c2dd99d438fdbe6a18c46eb18788/recipe/common.php#L53 https://github.com/deployphp/deployer/blob/a14383ba5931c2dd99d438fdbe6a18c46eb18788/src/functions.php#L349 https://github.com/deployphp/deployer/blob/a14383ba5931c2dd99d438fdbe6a18c46eb18788/docs/api.md#L230
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
I can confirm the issue. I think the problem is in \Deployer\run function:
foreach (['timeout', 'idle_timeout', 'secret', 'env', 'real_time_output', 'no_throw'] as $arg) {
if ($$arg !== null) {
$namedArguments[$arg] = $$arg;
}
}
and in \Deployer\runLocally function:
foreach (['timeout', 'idle_timeout', 'secret', 'env', 'shell'] as $arg) {
if ($$arg !== null) {
$namedArguments[$arg] = $$arg;
}
}
The if statement in the loops removes the timeout parameter passed to the function.
Setting to 0 disables the timeout.