Skip to content

Undefined constant "SIGTERM" on Windows #431

@hiryu85

Description

@hiryu85

Hello Mark,

I have a "problem" when I try to kill the worker.
Obviously it depends on Windows.

The error in question is:

Undefined constant "SIGTERM" in vendor\dereuromark\cakephp-queue\src\Model\Table\QueueProcessesTable.php on line 293
Stack Trace:
- ROOT\vendor\dereuromark\cakephp-queue\src\Command\WorkerCommand.php:157
- ROOT\vendor\dereuromark\cakephp-queue\src\Command\WorkerCommand.php:108
- CORE\src\Console\BaseCommand.php:202
- CORE\src\Console\CommandRunner.php:330
- CORE\src\Console\CommandRunner.php:168
- ROOT\bin\cake.php:10
- [main]

I temporarily solved it by changing the default $sig to null and if the OS is not Windows, setting it to \SIGTERM.

        if (!in_array(\PHP_OS_FAMILY, ['Windows', 'Unknow'])) {  // or use defined()?
            $sig = \SIGTERM;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions