From ba0e90922d217f3333abe5b09143a1e0cfb1a96f Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Wed, 18 May 2022 10:03:42 +0200 Subject: [PATCH] improve logging --- quetz/cli.py | 10 +++++++++- quetz/tasks/mirror.py | 7 +++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/quetz/cli.py b/quetz/cli.py index d6ce46b4..78500806 100644 --- a/quetz/cli.py +++ b/quetz/cli.py @@ -303,7 +303,15 @@ def _is_deployment(base_dir: Path): ): config = Config(str(config_file.resolve())) with working_directory(base_dir): - return database_exists(config.sqlalchemy_database_url) + if not database_exists(config.sqlalchemy_database_url): + logger.error( + "Cannot verify that specified database exists. " + + config.sqlalchemy_database_url + ) + return False + else: + return True + return False diff --git a/quetz/tasks/mirror.py b/quetz/tasks/mirror.py index 12137ff0..acddcd81 100644 --- a/quetz/tasks/mirror.py +++ b/quetz/tasks/mirror.py @@ -290,6 +290,9 @@ def initial_sync_mirror( ): force = True # needed for updating packages + logger.info( + f"Running channel mirroring {channel_name}/{arch} from {remote_repository.host}" + ) for repodata_fn in ["repodata_from_packages.json", "repodata.json"]: try: @@ -347,7 +350,7 @@ def initial_sync_mirror( def handle_batch(update_batch): # i_batch += 1 - logger.debug(f"Handling batch: {update_batch}") + logger.info(f"Handling batch: {[p[1] for p in update_batch]}") if not update_batch: return False @@ -517,7 +520,7 @@ def synchronize_packages( use_repodata: bool = False, ): - logger.debug(f"executing synchronize_packages task in a process {os.getpid()}") + logger.info(f"executing synchronize_packages task in a process {os.getpid()}") new_channel = dao.get_channel(channel_name)