Misc logging cleanup

This commit is contained in:
Brett Williams
2024-08-05 10:57:56 -05:00
parent 4df41a2079
commit 90d5e9b7af
4 changed files with 31 additions and 18 deletions

View File

@@ -498,6 +498,13 @@ def start_server():
time.sleep(delay_sec)
try:
Config.setup_config_dir()
Config.load_config(system_safe_path(os.path.join(Config.config_dir(), 'config.yaml')))
# suppress requests logging
logging.getLogger("requests").setLevel(logging.WARNING)
logging.getLogger("urllib3").setLevel(logging.WARNING)
# get hostname
local_hostname = socket.gethostname()
local_hostname = local_hostname + (".local" if not local_hostname.endswith(".local") else "")

View File

@@ -222,14 +222,14 @@ class DistributedJobManager:
for subjob_filename in subjob_files:
if subjob_filename not in local_files:
logger.info(f"Missing file '{subjob_filename}' from {subjob_hostname}")
try:
logger.debug(f"Downloading new file '{subjob_filename}' from {subjob_hostname}")
local_save_path = os.path.join(os.path.dirname(local_job.output_path), subjob_filename)
subjob_proxy.download_job_file(job_id=subjob_id, job_filename=subjob_filename,
save_path=local_save_path)
logger.debug(f'Downloaded successfully - {local_save_path}')
except Exception as e:
logger.error(f"Error downloading file '{subjob_filename}': {e}")
logger.error(f"Error downloading file '{subjob_filename}' from {subjob_hostname}: {e}")
except Exception as e:
logger.exception(f'Uncaught exception while trying to download from subjob: {e}')

View File

@@ -172,7 +172,7 @@ class EngineManager:
if background:
return thread
else:
thread.join()
found_engine = cls.is_version_downloaded(engine, version, system_os, cpu) # Check that engine downloaded
if not found_engine:
@@ -204,13 +204,19 @@ class EngineManager:
def engine_update_task(engine_class):
logger.debug(f"Checking for updates to {engine_class.name()}")
latest_version = engine_class.downloader().find_most_recent_version()
if latest_version:
logger.debug(f"Latest version of {engine_class.name()} available: {latest_version.get('version')}")
if not cls.is_version_downloaded(engine_class.name(), latest_version.get('version')):
logger.info(f"Downloading latest version of {engine_class.name()}...")
cls.download_engine(engine=engine_class.name(), version=latest_version['version'], background=True)
else:
logger.warning(f"Unable to get check for updates for {engine.name()}")
if not latest_version:
logger.warning(f"Could not find most recent version of {engine.name()} to download")
return
version_num = latest_version.get('version')
if cls.is_version_downloaded(engine_class.name(), version_num):
logger.debug(f"Latest version of {engine_class.name()} ({version_num}) already downloaded")
return
# download the engine
logger.info(f"Downloading latest version of {engine_class.name()} ({version_num})...")
cls.download_engine(engine=engine_class.name(), version=version_num, background=True)
logger.info(f"Checking for updates for render engines...")
threads = []

View File

@@ -132,8 +132,8 @@ class FFMPEGDownloader(EngineDownloader):
system_os = system_os or current_system_os()
cpu = cpu or current_system_cpu()
return cls.all_versions(system_os, cpu)[0]
except (IndexError, requests.exceptions.RequestException):
logger.error(f"Cannot get most recent version of ffmpeg")
except (IndexError, requests.exceptions.RequestException) as e:
logger.error(f"Cannot get most recent version of ffmpeg: {e}")
return {}
@classmethod