Remove duplicated file
The file was copy-pasted in api/search.
This commit is contained in:
parent
5075cd5bd0
commit
aa63389b4f
@ -1,38 +0,0 @@
|
||||
import logging
|
||||
|
||||
from algoliasearch.helpers import AlgoliaException
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def push_updated_user(user_to_index: dict):
|
||||
"""Push an update to the Algolia index when a user item is updated"""
|
||||
|
||||
from pillar.api.utils.algolia import index_user_save
|
||||
|
||||
try:
|
||||
index_user_save(user_to_index)
|
||||
except AlgoliaException as ex:
|
||||
log.warning(
|
||||
'Unable to push user info to Algolia for user "%s", id=%s; %s', # noqa
|
||||
user_to_index.get('username'),
|
||||
user_to_index.get('objectID'), ex)
|
||||
|
||||
|
||||
def index_node_save(node_to_index: dict):
|
||||
from pillar.api.utils import algolia
|
||||
|
||||
try:
|
||||
algolia.index_node_save(node_to_index)
|
||||
except AlgoliaException as ex:
|
||||
log.warning(
|
||||
'Unable to push node info to Algolia for node %s; %s', node_to_index, ex) # noqa
|
||||
|
||||
|
||||
def index_node_delete(delete_id: str):
|
||||
|
||||
from pillar.api.utils import algolia
|
||||
try:
|
||||
algolia.index_node_delete(delete_id)
|
||||
except AlgoliaException as ex:
|
||||
log.warning('Unable to delete node info to Algolia for node %s; %s', delete_id, ex) # noqa
|
Loading…
x
Reference in New Issue
Block a user