1

我必须在 cron 上运行命令来更新数据库。但是,这似乎给我的 Elastica 索引带来了问题。大概是因为事件订阅者没有被命令调用。

我的服务看起来像这样

fos_elastica.listener.application.client:
        class: 'Alpha\RMSBundle\EventListener\ClientListener'
        arguments:
            - '@fos_elastica.object_persister.application.client'
            - 'Alpha\RMSBundle\Entity\Position'
            - ['postPersist', 'postUpdate', 'postRemove', 'preRemove']
            - id
        calls:
            - [ setContainer, [ '@service_container' ] ]
        tags:
            - { name: 'doctrine.event_subscriber' }

有没有办法确保调用事件订阅者?

4

0 回答 0