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

[WIP] POC for SYNC connection support #233

Draft
wants to merge 1 commit into
base: 1.x
Choose a base branch
from

Conversation

sniper7kills
Copy link
Contributor

Line 68 & 69 show a POC way to handle the tenant. There should be some additional checks; and we will want to have that configurable...

I.E.
We have a private array of connection names we check against; that are loaded when this event is thrown

Obviously I'm not sure how good of an idea this would be; therefore it is a proof of concept at this time.
(Please close vs merging)

Line 68 & 69 show a POC way to handle the tenant. There *should* be some additional checks; and we will want to have that configurable...

I.E.
We have a private array of connection names we check against; that are loaded when this event is thrown

Obviously I'm not sure how good of an idea this would be; therefore it is a POC
@@ -64,7 +65,12 @@ public function __construct(JobProcessing $event)
$job = $this->unserializeToJob($command);
}

$tenant = $job->getTenant();
if ($event->connectionName == "sync" && !is_null(Tenancy::getTenant())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is sync meant to be the name of the connection configuration in the config files? If so, it'd be much better if we could key off of the driver value of sync(https://github.com/laravel/laravel/blob/8.x/config/queue.php#L34) instead of the name since the name could be changed to anything

@bkintanar
Copy link
Member

I think what Eric is saying about using the connection driver instead of the name would give us best results.

@luceos
Copy link
Contributor

luceos commented Sep 7, 2022

I'm curious to hear why this is necessary. Aside from it looking like a hack to support sync queue drivers, I'm curious why the tenant isn't identifying when using it. If that's the case, then there's a bug with the queue driver sync which should then be resolved instead?

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

Successfully merging this pull request may close these issues.

None yet

4 participants