Skip to content

Rewrite subscriber to Listener, and add lazy #241

@cryptiklemur

Description

@cryptiklemur

Due to how doctrine is written, in order for doctrine to see what events are subscribed to, the class needs to be instantiated. The Subscriber defined in this library depends on the client, which depends on the ClientContext. This ends up requiring that ALGOLIA_APP_ID and ALGOLIA_API_KEY are defined and correct in any and all environments, where they may not be necessary.

My specific use case is building a docker image. I should not have those variables in my docker image, but rather in the docker container as environment variables. Due to how Doctrine does this, I am unable to run a ./bin/console cache:clear as it runs the above code.

According to @weaverryan, you should be able to change to a Doctrine EventListener, and add lazy: true to the listener's tags, and this problem will go away.

symfony/symfony#27661

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions