Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multitenant duplicate query issue with Artisan::call #732

Open
mattvb91 opened this issue Feb 18, 2025 · 0 comments
Open

Multitenant duplicate query issue with Artisan::call #732

mattvb91 opened this issue Feb 18, 2025 · 0 comments

Comments

@mattvb91
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant