Skip to content

Commit

Permalink
fix(swoole): setAffinity does not exist on some versions of Swoole (#327
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mcharytoniuk authored May 6, 2024
1 parent bf5d32c commit 274076c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Backends/Swoole.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ function (Process $worker) use ($maxMessageLength, $queueItem) {
true,
);

$workerProcess->setAffinity([$currentCpu]);
if (method_exists($workerProcess, 'setAffinity')) {
$workerProcess->setAffinity([$currentCpu]);
}

$workerProcess->setBlocking(false);
$workerProcess->start();

Expand Down

0 comments on commit 274076c

Please sign in to comment.