barryvdh / laravel-snappy

Laravel Snappy PDF
MIT License
2.63k stars 290 forks source link

Setting config value "timeout" to false causes the process timeout default value 60 secs #462

Closed alperyazgan closed 2 years ago

alperyazgan commented 2 years ago

Presumably setting the "timeout" to false should make the pdf creation process use no time limit (unlimited processing time).

But it does not; actually the Process is created with the default values; (AbstractGenerator.php lines 594-602)

...
        if (\method_exists(Process::class, 'fromShellCommandline')) {
            $process = Process::fromShellCommandline($command, null, $this->env);
        } else {
            $process = new Process($command, null, $this->env);
        }

        if (null !== $this->timeout) { <-- timeout is null so the following line is omitted
            $process->setTimeout($this->timeout);
        }
...

The construct for the Process class, as you can easily see timeout is 60 secs

public function __construct(array $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)

So, Unlimited time for the process could not be achieved.

Regards,

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/KnpLabs/snappy instead. When having doubts, please try to reproduce the issue with just snappy. If you believe this is an actual issue with the latest version of laravel-snappy, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.