-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Reboot kernel & Multi tenancy #56
Comments
Hi! Thank you for trying this bundle 🙂
Can you give me an example of code that shows how your are injecting the
URL?
|
To manage multi tenancy on Symfony side we are using what is described in the following article: https://symfony.com/doc/current/configuration/override_dir_structure.html
So we consider the only "dynamic" part of our multi tenancy is handle by the container when being build so we use the getCacheDir method to make sure that on each request, cache corresponding to the correct client is loaded and the the db_url parameter in the container is OK.
Process is simplified but basically we get the client directory from a header added by our reverse proxy and make sure that the container is loaded for this specific client. That being said we need to have a new Kernel booted for each request otherwise the cache fetched could be from a previous request. So at the end for the moment we ended up writing our own RR worker. |
Hi,
We are trying to use roadrunner on a multi tenant symfony project.
Multi-tenancy is handled by the kernel, we inject database url dynamically depending on the request. This works fine with the PHP dev server however we cannot get it to work with roadrunner (missing database url).
I guess this comes from the fact that the kernel is not always rebooted. So we tried to set the strategy to always but this didn't have any effect. Furthermore we tried to add
$this->kernel->reboot(null);
at the beginning of the while loop in the Worker.php to make sure the container is rebuild but didn't seem to solve our problem either.Does anybody have any ideas on how to handle this ?
Thanks in advance !
The text was updated successfully, but these errors were encountered: