refactor: Optimize cache cleaning policy configuration flow
Move the common cleaning policy setting outside the conditional block to ensure it's always set first, regardless of the policy type. This change maintains the specific parameter settings for 'acp' and 'alru' policies while improving code structure and execution flow.
This commit is contained in:
parent
02a209aff8
commit
e20cf4f2fe
@ -635,15 +635,13 @@ def start_cache(cache, load, force=False):
|
||||
|
||||
def configure_cache(cache):
|
||||
if "cleaning_policy" in cache.params:
|
||||
casadm.set_param(
|
||||
"cleaning", cache_id=cache.cache_id, policy=cache.params["cleaning_policy"]
|
||||
)
|
||||
if cache.params["cleaning_policy"] == "acp" or cache.params["cleaning_policy"] == "alru":
|
||||
casadm.set_param_cleaning_policy(
|
||||
policy=cache.params["cleaning_policy"], cache_id=cache.cache_id, wake_up=cache.params["wake_up"], flush_max_buffers=cache.params["flush_max_buffers"]
|
||||
)
|
||||
else:
|
||||
casadm.set_param(
|
||||
"cleaning", cache_id=cache.cache_id, policy=cache.params["cleaning_policy"]
|
||||
)
|
||||
|
||||
|
||||
if "promotion_policy" in cache.params:
|
||||
casadm.set_param(
|
||||
|
Loading…
Reference in New Issue
Block a user