# HG changeset patch
# User Thierry Florac <thierry.florac@onf.fr>
# Date 1537193696 -7200
# Node ID f691b998d91da3be81a6161cde44f3cdf398e502
# Parent  984645eb238c3905b80cb105fb4180d816a35f51
Added savepoint in site indexer

diff -r 984645eb238c -r f691b998d91d src/pyams_content_es/site.py
--- a/src/pyams_content_es/site.py	Fri Jul 20 12:58:50 2018 +0200
+++ b/src/pyams_content_es/site.py	Mon Sep 17 16:14:56 2018 +0200
@@ -18,15 +18,13 @@
 
 # import interfaces
 from pyams_content_es.interfaces import IContentIndexerUtility, INDEXER_NAME, IDocumentIndexTarget
-from pyams_utils.interfaces.site import ISiteGenerations
-
 # import packages
 from pyams_content_es.utility import ContentIndexerUtility
 from pyams_utils.container import find_objects_providing
+from pyams_utils.interfaces.site import ISiteGenerations
 from pyams_utils.registry import utility_config, set_local_registry, query_utility
 from pyams_utils.site import check_required_utilities, site_factory
 
-
 REQUIRED_UTILITIES = ((IContentIndexerUtility, '', ContentIndexerUtility, INDEXER_NAME), )
 
 
@@ -58,6 +56,7 @@
                 for document in find_objects_providing(application, IDocumentIndexTarget):
                     print("Indexing: {0!r}".format(document))
                     es_client.index_object(document)
+                    transaction.savepoint()
         finally:
             set_local_registry(None)
         transaction.commit()