T53161 start working on elastic..

This commit is contained in:
2017-10-25 17:09:10 +02:00
parent 49a6a6a758
commit 2233d015f3
7 changed files with 98 additions and 40 deletions

View File

@@ -0,0 +1,30 @@
import logging
from . import algolia_tasks
from pillar import current_app
log = logging.getLogger(__name__)
# TODO make index backend conditional on settings.
# now uses angolia, but should use elastic
@current_app.celery.task(ignore_result=True)
def updated_user(user_id: str):
"""Push an update to the index when a user item is updated"""
algolia_tasks.push_updated_user_to_algolia(user_id)
@current_app.celery.task(ignore_result=True)
def node_save(node_id: str):
algolia_tasks.index_node_save(node_id)
@current_app.celery.task(ignore_result=True)
def node_delete(node_id: str):
algolia_tasks.index_node_delete(node_id)