diff --git a/src/layman/celery.py b/src/layman/celery.py index c9e792061..dea065fa0 100644 --- a/src/layman/celery.py +++ b/src/layman/celery.py @@ -107,7 +107,7 @@ def finish_publication_chain(last_task_id_in_chain): rds.hdel(key, hash) lock = redis_util.get_publication_lock(username, publication_type, publication_name) - if lock in [common.REQUEST_METHOD_PATCH, common.REQUEST_METHOD_POST, common.PUBLICATION_LOCK_WFST, ]: + if lock in [common.REQUEST_METHOD_PATCH, common.REQUEST_METHOD_POST, common.PUBLICATION_LOCK_FEATURE_CHANGE, ]: redis_util.unlock_publication(username, publication_type, publication_name) diff --git a/src/layman/common/__init__.py b/src/layman/common/__init__.py index b16f79c84..6f1b911f5 100644 --- a/src/layman/common/__init__.py +++ b/src/layman/common/__init__.py @@ -9,7 +9,7 @@ PUBLICATION_LOCK_POST = REQUEST_METHOD_POST PUBLICATION_LOCK_PATCH = REQUEST_METHOD_PATCH PUBLICATION_LOCK_DELETE = REQUEST_METHOD_DELETE -PUBLICATION_LOCK_WFST = 'wfst' +PUBLICATION_LOCK_FEATURE_CHANGE = 'feature_change' InternalSourceTypeDef = namedtuple('InternalSourceTypeDef', ['info_items', ]) diff --git a/src/layman/common/redis.py b/src/layman/common/redis.py index 78f13133a..b4e628b73 100644 --- a/src/layman/common/redis.py +++ b/src/layman/common/redis.py @@ -71,11 +71,11 @@ def solve_locks(workspace, publication_type, publication_name, error_code, reque if current_lock is None: return if requested_lock not in [common.PUBLICATION_LOCK_PATCH, common.PUBLICATION_LOCK_DELETE, - common.PUBLICATION_LOCK_WFST, ]: + common.PUBLICATION_LOCK_FEATURE_CHANGE, ]: raise Exception(f"Unknown method to check: {requested_lock}") if current_lock not in [common.PUBLICATION_LOCK_PATCH, common.PUBLICATION_LOCK_DELETE, common.PUBLICATION_LOCK_POST, - common.PUBLICATION_LOCK_WFST, ]: + common.PUBLICATION_LOCK_FEATURE_CHANGE, ]: raise Exception(f"Unknown current lock: {current_lock}") if current_lock in [common.PUBLICATION_LOCK_PATCH, common.PUBLICATION_LOCK_POST, ]: if requested_lock in [common.PUBLICATION_LOCK_PATCH, common.PUBLICATION_LOCK_POST, ]: @@ -84,9 +84,9 @@ def solve_locks(workspace, publication_type, publication_name, error_code, reque if requested_lock in [common.PUBLICATION_LOCK_PATCH, common.PUBLICATION_LOCK_POST, ]: raise LaymanError(error_code) if requested_lock not in [common.PUBLICATION_LOCK_DELETE, ]: - if requested_lock == common.PUBLICATION_LOCK_WFST: + if requested_lock == common.PUBLICATION_LOCK_FEATURE_CHANGE: raise LaymanError(19, private_data={'can_run_later': True}) - if current_lock == common.PUBLICATION_LOCK_WFST and requested_lock in [common.REQUEST_METHOD_PATCH, common.REQUEST_METHOD_POST, ]: + if current_lock == common.PUBLICATION_LOCK_FEATURE_CHANGE and requested_lock in [common.REQUEST_METHOD_PATCH, common.REQUEST_METHOD_POST, ]: celery_util.abort_publication_chain(workspace, publication_type, publication_name) celery_util.push_step_to_run_after_chain(workspace, publication_type, publication_name, 'layman.util::patch_after_feature_change') diff --git a/src/layman/util.py b/src/layman/util.py index 17a725260..5d8adc78f 100644 --- a/src/layman/util.py +++ b/src/layman/util.py @@ -393,7 +393,7 @@ def delete_publications(user, def patch_after_feature_change(workspace, publication_type, publication, **kwargs): try: - redis.create_lock(workspace, publication_type, publication, 19, common.PUBLICATION_LOCK_WFST) + redis.create_lock(workspace, publication_type, publication, 19, common.PUBLICATION_LOCK_FEATURE_CHANGE) except LaymanError as exc: if exc.code == 19 and exc.private_data.get('can_run_later', False): celery_util.push_step_to_run_after_chain(workspace, publication_type, publication,