[#4577] introduced the BatchIndexer extension for the artifact session, specifically for use in migrations. Next step is to use the new extension in the Allura webapp.
BatchIndexer and the substitute_extensions context manager into the Allura code base.artifact_orm_session with BatchIndexer instead of ArtifactSessionExtension.MingMiddleware to flush BatchIndexer at the end of a web request.BatchIndexer at the end of a script run.
We should also use it during the
reindexcommandBatchIndexer has already been moved to the Allura codebase and is used during improt tasks. Using it in web requests is not going to help much since not my artifacts are added in a normal request, and there are not normally multiple session flush() calls anyway.