From 5a2aa9429a73fbbea6468e4dfe20f5eef7f40755 Mon Sep 17 00:00:00 2001 From: PascalEgn Date: Tue, 14 Nov 2023 17:53:18 +0100 Subject: [PATCH] doc download: add save workflow feature flag --- inspirehep/config.py | 1 + inspirehep/modules/workflows/tasks/actions.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/inspirehep/config.py b/inspirehep/config.py index 66a505ea0c..693f337e52 100644 --- a/inspirehep/config.py +++ b/inspirehep/config.py @@ -58,6 +58,7 @@ """This feature flag will prevent to send a ``replace`` update to legacy.""" FEATURE_FLAG_USE_ROOT_TABLE_ON_HEP = False FEATURE_FLAG_ENABLE_SNOW = False +FEATURE_FLAG_ENABLE_SAVE_WORFLOW_ON_DOWNLOAD_DOCUMENTS = True # Default language and timezone # ============================= BABEL_DEFAULT_LANGUAGE = 'en' diff --git a/inspirehep/modules/workflows/tasks/actions.py b/inspirehep/modules/workflows/tasks/actions.py index e39743b820..e9f7e03828 100644 --- a/inspirehep/modules/workflows/tasks/actions.py +++ b/inspirehep/modules/workflows/tasks/actions.py @@ -453,7 +453,8 @@ def download_documents(obj, eng): obj.log.error( 'Cannot download document from %s', url) delete_empty_key(obj, 'documents') - save_workflow(obj, eng) + if current_app.config['FEATURE_FLAG_ENABLE_SAVE_WORFLOW_ON_DOWNLOAD_DOCUMENTS']: + save_workflow(obj, eng) LOGGER.info('Documents downloaded: %s', len(obj.data.get('documents', [])))