~alejdg/ubuntu-repository-cache/bionic

« back to all changes in this revision

Viewing changes to lib/ubuntu_repository_cache/metadata_sync.py

Merge lp:~fginther/cloudware/ubuntu-repository-cache-various-fixes into lp:~cloudware/cloudware/ubuntu-repository-cache

Various fixes.

[a=fginther] [r=tribaal]

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from .util import (
25
25
    FileSemaphore,
 
26
    REPO_SYNC_CRON_LOG,
26
27
    SemaphoreExistsError,
27
28
    SEMAPHORE_FILE,
28
29
)
166
167
 
167
168
    hosts_tried = 0
168
169
 
169
 
    while hosts_tried < MAX_HOSTS_TO_TRY:
 
170
    while not content_mirrored and hosts_tried < MAX_HOSTS_TO_TRY:
170
171
        archive_ip = next(archive_ip_iterator)
171
172
        hosts_tried = hosts_tried + 1
172
173
 
504
505
    # move to leverage the logging infrastructure better. ~tribaal
505
506
    import logging
506
507
 
507
 
    file_handler = logging.FileHandler('/var/log/repository-sync-cron.log')
 
508
    file_handler = logging.FileHandler(REPO_SYNC_CRON_LOG)
508
509
    file_handler.setLevel(logging.INFO)
509
510
 
510
511
    basic_formatter = logging.Formatter('%(asctime)s - %(message)s')