Multitenant duplicate query issue with Artisan::call
I have the following pseudo code:
foreach($tenants as $tenant) {
Artisan::call('command', ['--uid' => $tenant->id]);
}
This seems to be calling clock->storeRequest() after each Artisan::call(), However what seems to be happening is that each $request->databaseQueries is not reset and is appended to with the previous databaseQueries added on top leading to duplicate queries being shown in clockwork that weren't actually executed.
Any guidance on how to handle situations like this where im tracking individual commands within the context of a global request?
i realize this is a difficult example for a reproducible, if we are completely stuck I will try to create a sample repo
Hey, thanks for the report, I will try to investigate this weekend.
This should be now fixed in master (https://github.com/itsgoingd/clockwork/commit/229a43f1b663ea0cf418e4f9ca58448315765484). Database queries from the called commands should now be correctly included in the parent command as intended.
Fixed in Clockwork 5.3.5.