Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build_wheel_off.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build wheel and release into PYPI (off now)


on:
push:
branches:
Expand Down
7 changes: 5 additions & 2 deletions automation/script/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,12 @@ def _run(self, i):
variation_tags,
parsed_script_alias,
quiet,
skip_remembered_selections=False,
skip_remembered_selections=skip_remembered_selections,
force_cache=False,
force_skip_cache=False
# Forcing this to false as with new_cache_entry we want to exclude
# any force_cached cache entries
force_skip_cache=False,
new_cache_entry=new_cache_entry
)
if r['return'] > 0:
return r
Expand Down
21 changes: 3 additions & 18 deletions automation/script/script_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def select_script_and_cache(
skip_remembered_selections=False,
force_cache=False,
force_skip_cache=False,
new_cache_entry=False
):
"""
Search scripts by tags, resolve ambiguity, apply cache pruning,
Expand Down Expand Up @@ -133,19 +134,16 @@ def select_script_and_cache(

# ---------------------------------------------------------
# STEP 6: Determine if cache preload is needed
preload_cached_scripts = any(
preload_cached_scripts = not new_cache_entry and any(
s.meta.get("cache", False)
or (s.meta.get("can_force_cache", False) and force_cache)
for s in list_of_found_scripts
)

cache_list = []

# STEP: cache handling
cache_list = []

if should_preload_cache(list_of_found_scripts,
force_cache) and not force_skip_cache:
if preload_cached_scripts:
rc = search_script_cache(
self.cache_action,
script_tags_string,
Expand All @@ -165,7 +163,6 @@ def select_script_and_cache(
list_of_found_scripts = rc["scripts"]
cache_list = rc["cache_list"]

# STEP: select script (unchanged)
if len(list_of_found_scripts) > 1:
selected_index = select_script_item(
list_of_found_scripts,
Expand Down Expand Up @@ -262,18 +259,6 @@ def select_script_item(lst, text, recursion_spaces,
return selection


def should_preload_cache(scripts, force_cache=False):
"""
Return True if at least one script requires or allows caching.
"""
for script in scripts:
if script.meta.get("cache", False):
return True
if script.meta.get("can_force_cache", False) and force_cache:
return True
return False


def search_script_cache(
cache_action,
script_tags_string,
Expand Down
Loading