Adding ability to turn off file deletion in configuration.

This commit is contained in:
Dan 2020-10-15 16:16:46 -04:00
parent c239034c00
commit 444c0cfebb
2 changed files with 5 additions and 1 deletions

View File

@ -50,7 +50,10 @@ def _update_data():
for file in files:
db.session.add(file)
db.session.commit()
ivy_service.delete_file(file.file_name)
if app.config['DELETE_IVY_FILES']:
ivy_service.delete_file(file.file_name)
else:
app.logger.info("Not Deleting Files, per DELETE_IVY_FILES flag")
db.session.commit()

View File

@ -56,6 +56,7 @@ MAIL_TIMEOUT = 10
# Ivy Directory
IVY_IMPORT_DIR = environ.get('IVY_IMPORT_DIR', default='')
DELETE_IVY_FILES = environ.get('DELETE_IVY_FILES', default="false") == "true"
# Globus endpoint connections
GLOBUS_CLIENT_ID = environ.get('GLOBUS_CLIENT_ID')