From ce173976cd800e8ca88b530760f5b78daa866c78 Mon Sep 17 00:00:00 2001 From: Netkas Date: Tue, 28 Feb 2023 21:32:47 -0500 Subject: [PATCH] Updated \TamerLib\Protocols\Gearman with more logging calls --- src/TamerLib/Protocols/Gearman/Client.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/TamerLib/Protocols/Gearman/Client.php b/src/TamerLib/Protocols/Gearman/Client.php index d7164c7..7ae3a0d 100644 --- a/src/TamerLib/Protocols/Gearman/Client.php +++ b/src/TamerLib/Protocols/Gearman/Client.php @@ -286,20 +286,22 @@ $this->tasks[] = $task; $job = new Job($task); + $job_data = msgpack_pack($job->toArray()); + Log::debug('net.nosial.tamerlib', 'sending closure to gearman server: ' . strlen($job_data) . ' bytes'); switch($task->getPriority()) { case TaskPriority::High: - $this->client->doHighBackground($task->getFunctionName(), msgpack_pack($job->toArray())); + $this->client->doHighBackground($task->getFunctionName(), $job_data); break; case TaskPriority::Low: - $this->client->doLowBackground($task->getFunctionName(), msgpack_pack($job->toArray())); + $this->client->doLowBackground($task->getFunctionName(), $job_data); break; default: case TaskPriority::Normal: - $this->client->doBackground($task->getFunctionName(), msgpack_pack($job->toArray())); + $this->client->doBackground($task->getFunctionName(), $job_data); break; } } @@ -316,20 +318,22 @@ $this->tasks[] = $task; $job = new Job($task); + $job_data = msgpack_pack($job->toArray()); + Log::debug('net.nosial.tamerlib', 'sending closure to gearman server: ' . strlen($job_data) . ' bytes'); switch($task->getPriority()) { case TaskPriority::High: - $this->client->addTaskHigh($task->getFunctionName(), msgpack_pack($job->toArray())); + $this->client->addTaskHigh($task->getFunctionName(), $job_data); break; case TaskPriority::Low: - $this->client->addTaskLow($task->getFunctionName(), msgpack_pack($job->toArray())); + $this->client->addTaskLow($task->getFunctionName(), $job_data); break; default: case TaskPriority::Normal: - $this->client->addTask($task->getFunctionName(), msgpack_pack($job->toArray())); + $this->client->addTask($task->getFunctionName(), $job_data); break; } }