Skip to content

Commit

Permalink
improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed May 18, 2022
1 parent 5d3a032 commit ba0e909
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 9 additions & 1 deletion quetz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
7 changes: 5 additions & 2 deletions quetz/tasks/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit ba0e909

Please sign in to comment.