Closed hanicab closed 11 months ago
@hanicab How are you running your queue workers?
I found that a similar issue is caused because of the long running worker queue. I ended up on rather simple fix for this issue. Switch production to run worker:listen instead of worker:queue. There is a very small performance penalty for booting the framework for each job but it is better to get the right and proper result.
@benddailey Thank you for your reply,
I use horizon,
The problem is only when dispatching queued closure from tenant context (as described)
Works perfectly :
MyCustomJob::dispatch();
Not working (current tenant not dtermined exception) :
dispatch(function(){
Order::where('id',123)->delete();
});
Try again with the release 3.0.3. Thanks!
Try again with the release 3.0.3. Thanks!
I'm on 3.0.3 and I encounter the same error.
@bcalik, please try adding CallQueuedClosure::class
to queueable_to_job
in config/multitenancy.php
, so finally, you should have the config like so:
'queueable_to_job' => [
// ...
CallQueuedClosure::class => 'closure', // <-- ADD THIS
// ...
],
Thanks
Solved with release 3.1.0.
Hello,
Current tenant could not be determined when dispatching queued closure from tenant context, even if jobs are configured to be tenant aware by default.
Can you please help to resolve this problem ?
How to make queued closure tenant aware ?
Best regards