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

Fallback in case connection fail #135

Open
choks87 opened this Issue Sep 17, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@choks87

choks87 commented Sep 17, 2018

It would be good if we could have a fallback adapter (NullAdapter) in the case when some adapter fails to connect.

Ex. if Redis adapter throws ConnectionException and if the fallback option is set, no exception is thrown, but it will use NullAdapter.

Right now, if Redis is not available, app dies.
This could be achieved by adding some listeners directly in the app, and catch block, but if autowiring is used, it will fail.

example config:

cache_adapter:
    fallback_provider: @cache.provider.void
    providers:
        redis:
            factory: cache.factory.redis
            options:
                host: '%env(REDIS_HOST)%'
                port: '%env(REDIS_PORT)%'
         void:
            factory: cache.factory.void

@choks87 choks87 changed the title from Fallback to Fallback Provider in case connection fail Sep 17, 2018

@choks87 choks87 changed the title from Fallback Provider in case connection fail to Fallback in case connection fail Sep 17, 2018

@choks87

This comment has been minimized.

Show comment
Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment