diff --git a/cms/envs/common.py b/cms/envs/common.py index 28f9969436..543f481b38 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -155,9 +155,6 @@ BLOCK_STRUCTURES_SETTINGS = dict( # Maximum number of retries per task. TASK_MAX_RETRIES=5, - - # Backend storage options - PRUNING_ACTIVE=False, ) ############################ FEATURE CONFIGURATION ############################# diff --git a/cms/envs/devstack-experimental.yml b/cms/envs/devstack-experimental.yml index 26311bf0fb..08cb101f5f 100644 --- a/cms/envs/devstack-experimental.yml +++ b/cms/envs/devstack-experimental.yml @@ -43,7 +43,6 @@ BLOCKSTORE_API_URL: http://localhost:18250/api/v1 BLOCKSTORE_PUBLIC_URL_ROOT: http://localhost:18250 BLOCK_STRUCTURES_SETTINGS: COURSE_PUBLISH_TASK_DELAY: 30 - PRUNING_ACTIVE: false TASK_DEFAULT_RETRY_DELAY: 30 TASK_MAX_RETRIES: 5 BRANCH_IO_KEY: '' diff --git a/cms/envs/test.py b/cms/envs/test.py index e856034d08..118b3f1b0c 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -95,8 +95,6 @@ STATICFILES_DIRS += [ STATICFILES_STORAGE = 'pipeline.storage.NonPackagingPipelineStorage' STATIC_URL = "/static/" -BLOCK_STRUCTURES_SETTINGS['PRUNING_ACTIVE'] = True - # Update module store settings per defaults for tests update_module_store_settings( MODULESTORE, diff --git a/lms/envs/common.py b/lms/envs/common.py index e4274f4b3f..26a4dafded 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2884,22 +2884,6 @@ BLOCK_STRUCTURES_SETTINGS = dict( # For more information, check https://github.com/openedx/edx-platform/pull/13388 and # https://github.com/openedx/edx-platform/pull/14571. TASK_MAX_RETRIES=5, - - # .. toggle_name: BLOCK_STRUCTURES_SETTINGS['PRUNING_ACTIVE'] - # .. toggle_implementation: DjangoSetting - # .. toggle_default: False - # .. toggle_description: When `True`, only a specified number of versions of block structure - # files are kept for each structure, and the rest are cleaned up. The number of versions that - # are kept can be specified in the `BlockStructureConfiguration`, which can be edited in - # Django Admin. The default number of versions that are kept is `5`. - # .. toggle_warning: This toggle will likely be deprecated and removed. - # .. toggle_use_cases: temporary - # .. toggle_creation_date: 2018-03-22 - # .. toggle_target_removal_date: 2018-06-22 - # .. toggle_tickets: https://github.com/openedx/edx-platform/pull/14571, - # https://github.com/openedx/edx-platform/pull/17760, - # https://openedx.atlassian.net/browse/DEPR-146 - PRUNING_ACTIVE=False, ) ################################ Bulk Email ################################### diff --git a/lms/envs/devstack-experimental.yml b/lms/envs/devstack-experimental.yml index 96b8952c82..e69656a803 100644 --- a/lms/envs/devstack-experimental.yml +++ b/lms/envs/devstack-experimental.yml @@ -61,7 +61,6 @@ BLOCKSTORE_API_URL: http://localhost:18250/api/v1 BLOCKSTORE_PUBLIC_URL_ROOT: http://localhost:18250 BLOCK_STRUCTURES_SETTINGS: COURSE_PUBLISH_TASK_DELAY: 30 - PRUNING_ACTIVE: false TASK_DEFAULT_RETRY_DELAY: 30 TASK_MAX_RETRIES: 5 BRANCH_IO_KEY: '' diff --git a/lms/envs/test.py b/lms/envs/test.py index 18cdcb7f14..284ebc915d 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -327,8 +327,6 @@ FILE_UPLOAD_HANDLERS = [ 'django.core.files.uploadhandler.TemporaryFileUploadHandler', ] -BLOCK_STRUCTURES_SETTINGS['PRUNING_ACTIVE'] = True - ########################### Server Ports ################################### # These ports are carefully chosen so that if the browser needs to diff --git a/openedx/core/djangoapps/content/block_structure/models.py b/openedx/core/djangoapps/content/block_structure/models.py index b183bb5949..4872e09346 100644 --- a/openedx/core/djangoapps/content/block_structure/models.py +++ b/openedx/core/djangoapps/content/block_structure/models.py @@ -234,11 +234,9 @@ class BlockStructureModel(TimeStampedModel): with _storage_error_handling(bs_model, operation): bs_model.data.save('', ContentFile(serialized_data)) - cls._log(bs_model, operation, serialized_data) - if not created: cls._prune_files(data_usage_key) - + cls._log(bs_model, operation, serialized_data) return bs_model, created def __str__(self): @@ -255,9 +253,6 @@ class BlockStructureModel(TimeStampedModel): """ Deletes previous file versions for data_usage_key. """ - if not settings.BLOCK_STRUCTURES_SETTINGS.get('PRUNING_ACTIVE', False): - return - if num_to_keep is None: num_to_keep = config.num_versions_to_keep() @@ -272,7 +267,6 @@ class BlockStructureModel(TimeStampedModel): data_usage_key, num_to_keep, ) - except Exception: # pylint: disable=broad-except log.exception('BlockStructure: Exception when deleting old files; data_usage_key: %s.', data_usage_key) diff --git a/openedx/core/djangoapps/content/block_structure/tests/test_models.py b/openedx/core/djangoapps/content/block_structure/tests/test_models.py index 08916151e7..39bb68b094 100644 --- a/openedx/core/djangoapps/content/block_structure/tests/test_models.py +++ b/openedx/core/djangoapps/content/block_structure/tests/test_models.py @@ -9,7 +9,6 @@ from unittest.mock import Mock, patch import ddt import pytest -from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.test import TestCase from django.utils.timezone import now @@ -80,7 +79,6 @@ class BlockStructureModelTestCase(TestCase): return bsm @patch('openedx.core.djangoapps.content.block_structure.models.log') - @patch.dict(settings.BLOCK_STRUCTURES_SETTINGS, {'PRUNING_ACTIVE': False}) def test_update_or_create(self, mock_log): serialized_data = 'initial data'