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

Set connection definition to be lazy #82

Merged
merged 1 commit into from
Sep 25, 2018
Merged

Conversation

dkarlovi
Copy link
Contributor

Having the connection be lazy allows to prebuild the container cache without having an Influxdb server available

Basically the same idea as snc/SncRedisBundle#440

Having the connection be lazy allows to prebuild the container cache without having an Influxdb server available
@Algatux
Copy link
Owner

Algatux commented Sep 24, 2018

@dkarlovi Hi! Thanks for your PR. I want to investigate a little because influxdb works like an api and I am not sure that declaring the service as lazy is needed. It does not make a persistent connection

@dkarlovi
Copy link
Contributor Author

@Algatux this is not used for a persistent connection, it's more to avoid creating a connection while building the container (which happens currently).

You can see this behaviour if you use the bundle with a Dockerized app which you prebuild the cache of at Docker image's build time.

See snc/SncRedisBundle#434 for a full description of the problem, it's ecactly the same issue here:

In containerized apps, it's common to pre-warm cache while building the image. This allows for the container to come in with warm cache and just start working as if it's here forever.

With SncRedisBundle, this is currently not possible as it seems the bundle is trying to connect to the Redis server at build time. But, not only the Redis server might not be available at build time, its connection string is also not known (supplied later via env).

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.

2 participants