'HttpAsyncJob' executed synchronously, why?

Hello everyone,

I’m having an issue with the HttpAsyncJob in Kanboard. I’ve created an instance of the job and set the parameters as follows:

$job = HttpAsyncJob::getInstance($this->container)->withParams(
   'POST',
   "https://api.telegram.org/bot" . $apikey . "/sendMessage",
   json_encode($data),
   array_merge(['Content-type: application/json'], []),
   false
);
$this->queueManager->push($job);

However, when I push the job to the queue using $this->queueManager->push($job);, the debug log shows that the job was executed synchronously:

[2024-07-25 15:27:53] [debug] Kanboard\Core\Queue\QueueManager::push: Job executed synchronously: Kanboard\Job\HttpAsyncJob

I’m expecting the job to be executed asynchronously, but it seems like it’s being executed immediately. Can anyone help me understand why this is happening?

Is there something wrong with my code or is there a configuration issue that I’m missing?

Thanks in advance for your help!

I might be wrong, but AFAIK, if the queue is idle, the job will be executed immediately. If there are any pending jobs, your job will be queued.

Thanks @alfredb

I’m trying to fix the loading issue caused by the notification plugin. Can I remove or reduce this loading delay using some async method, like queuing the job or running it in the background?

Kanboard-notification-delay

TBH, I have no clue what you’re talking about. Please be more precise, show some code whenever possible.