Closed dwrzos closed 3 months ago
Please post a demo repo to test the issue.
Bit less elegant but I managed to make it work:
return Application::configure(basePath: dirname(__DIR__))
->withRouting(web: __DIR__.'/../routes/web.php')
->withSchedule(function (Schedule $schedule) {
$schedule->call(function () {
foreach (Tenant::all() as $tenant) {
$tenant->makeCurrent();
SaveFeedsJob::dispatch();
}
})->everyFourHours();
$schedule->call(function () {
foreach (Tenant::all() as $tenant) {
$tenant->makeCurrent();
SaveSalesJob::dispatch();
}
})->dailyAt('01:00');
})
->withExceptions()
->create();
bootstrap.app file:
SaveFeedsJob and SaveSalesJob are not dispatched, although scheduler is running.
Output of
php artisan schedule:list
when there are 2 tenants:So looks like it should be dispatched for each tenant.
Queue connection is set to database. Jobs and failed jobs table are in landlord database.
What am I doing wrong?