[101] fix resume

pull/1566/head
meisnate12 1 year ago
parent c116601cec
commit f38f73791f

@ -1 +1 @@
1.19.0-develop100 1.19.0-develop101

@ -1073,7 +1073,11 @@ class MetadataFile(DataFile):
else: else:
test_override.append(v) test_override.append(v)
test = util.parse("Config", "test", dynamic, parent=map_name, methods=methods, default=False, datatype="bool") if "test" in methods else False test = util.parse("Config", "test", dynamic, parent=map_name, methods=methods, default=False, datatype="bool") if "test" in methods else False
sync = util.parse("Config", "sync", dynamic, parent=map_name, methods=methods, default=False, datatype="bool") if "sync" in methods else False sync = False
if "sync" in self.temp_vars:
sync = util.parse("Config", "sync", self.temp_vars["sync"], parent="template_variables", datatype="bool")
elif "sync" in methods:
sync = util.parse("Config", "sync", dynamic, parent=map_name, methods=methods, default=False, datatype="bool")
if "<<library_type>>" in title_format: if "<<library_type>>" in title_format:
title_format = title_format.replace("<<library_type>>", library.type.lower()) title_format = title_format.replace("<<library_type>>", library.type.lower())
if "<<library_typeU>>" in title_format: if "<<library_typeU>>" in title_format:

@ -593,7 +593,7 @@ def run_libraries(config):
continue continue
logger.info("") logger.info("")
logger.separator(f"Running {images_name} Images File\n{images.path}") logger.separator(f"Running {images_name} Images File\n{images.path}")
if not run_args["tests"] and not resume and not run_args["collections-only"]: if not run_args["tests"] and not run_args["resume"] and not run_args["collections-only"]:
try: try:
images.update_metadata() images.update_metadata()
except Failed as e: except Failed as e:
@ -610,20 +610,20 @@ def run_libraries(config):
continue continue
logger.info("") logger.info("")
logger.separator(f"Running {metadata_name} Metadata File\n{metadata.path}") logger.separator(f"Running {metadata_name} Metadata File\n{metadata.path}")
if not run_args["tests"] and not resume and not run_args["collections-only"]: if not run_args["tests"] and not run_args["resume"] and not run_args["collections-only"]:
try: try:
metadata.update_metadata() metadata.update_metadata()
except Failed as e: except Failed as e:
library.notify(e) library.notify(e)
logger.error(e) logger.error(e)
collections_to_run = metadata.get_collections(config.requested_collections) collections_to_run = metadata.get_collections(config.requested_collections)
if resume and resume not in collections_to_run: if run_args["resume"] and run_args["resume"] not in collections_to_run:
logger.info("") logger.info("")
logger.warning(f"Collection: {resume} not in Metadata File: {metadata.path}") logger.warning(f"Collection: {run_args['resume']} not in Metadata File: {metadata.path}")
continue continue
if collections_to_run: if collections_to_run:
logger.info("") logger.info("")
logger.separator(f"{'Test ' if run_args['test'] else ''}Collections") logger.separator(f"{'Test ' if run_args['tests'] else ''}Collections")
logger.remove_library_handler(library.mapping_name) logger.remove_library_handler(library.mapping_name)
run_collection(config, library, metadata, collections_to_run) run_collection(config, library, metadata, collections_to_run)
logger.re_add_library_handler(library.mapping_name) logger.re_add_library_handler(library.mapping_name)
@ -640,7 +640,6 @@ def run_libraries(config):
return library_status return library_status
def run_collection(config, library, metadata, requested_collections): def run_collection(config, library, metadata, requested_collections):
global resume
logger.info("") logger.info("")
for mapping_name, collection_attrs in requested_collections.items(): for mapping_name, collection_attrs in requested_collections.items():
collection_start = datetime.now() collection_start = datetime.now()
@ -659,10 +658,10 @@ def run_collection(config, library, metadata, requested_collections):
if no_template_test: if no_template_test:
continue continue
if resume and resume != mapping_name: if run_args["resume"] and run_args["resume"] != mapping_name:
continue continue
elif resume == mapping_name: elif run_args["resume"] == mapping_name:
resume = None run_args["resume"] = None
logger.info("") logger.info("")
logger.separator(f"Resuming Collections") logger.separator(f"Resuming Collections")

Loading…
Cancel
Save