Switch to after_commit to update the index
1. If there is a rollback, some objects could be updated in the elasticsearch index but not in the database. Updating the index after commit ensures this can't happen. 2. In after_flush, not all relationships are updated properly. We need to retrieve the objects in the after_flush_postexec event. It can't be done in the after_commit event because we can't emit SQL at that point. See https://groups.google.com/forum/#!topic/sqlalchemy/GdB5J8h7YEU JIRA INFRA-595
Loading
Please register or sign in to comment