diff --git a/arkindex/documents/export/__init__.py b/arkindex/documents/export/__init__.py index 3c5b3f3a4ff9f23c4eab52f07e2d821e97426f56..ac1ccd78142bd42c8fece5e1299e0f9ab9d8f830 100644 --- a/arkindex/documents/export/__init__.py +++ b/arkindex/documents/export/__init__.py @@ -129,6 +129,7 @@ def update_state(corpus_export: CorpusExport, state: CorpusExportState): corpus_export.save() except (InterfaceError, OperationalError) as e: logger.warning(f"Database connection has been lost, retrying: {e}") + connections["default"].connection = None connections["default"].connect() corpus_export.refresh_from_db(using="default") corpus_export.state = state