|
@@ -48,6 +48,7 @@ class Cache:
|
|
self.manifest = manifest
|
|
self.manifest = manifest
|
|
self.path = path or os.path.join(get_cache_dir(), hexlify(repository.id).decode('ascii'))
|
|
self.path = path or os.path.join(get_cache_dir(), hexlify(repository.id).decode('ascii'))
|
|
self.do_files = do_files
|
|
self.do_files = do_files
|
|
|
|
+ logger.info('initializing cache')
|
|
# Warn user before sending data to a never seen before unencrypted repository
|
|
# Warn user before sending data to a never seen before unencrypted repository
|
|
if not os.path.exists(self.path):
|
|
if not os.path.exists(self.path):
|
|
if warn_if_unencrypted and isinstance(key, PlaintextKey):
|
|
if warn_if_unencrypted and isinstance(key, PlaintextKey):
|
|
@@ -69,6 +70,7 @@ class Cache:
|
|
# Make sure an encrypted repository has not been swapped for an unencrypted repository
|
|
# Make sure an encrypted repository has not been swapped for an unencrypted repository
|
|
if self.key_type is not None and self.key_type != str(key.TYPE):
|
|
if self.key_type is not None and self.key_type != str(key.TYPE):
|
|
raise self.EncryptionMethodMismatch()
|
|
raise self.EncryptionMethodMismatch()
|
|
|
|
+ logger.info('synchronizing cache')
|
|
self.sync()
|
|
self.sync()
|
|
self.commit()
|
|
self.commit()
|
|
|
|
|
|
@@ -163,6 +165,7 @@ Chunk index: {0.total_unique_chunks:20d} {0.total_chunks:20d}""")
|
|
def _read_files(self):
|
|
def _read_files(self):
|
|
self.files = {}
|
|
self.files = {}
|
|
self._newest_mtime = 0
|
|
self._newest_mtime = 0
|
|
|
|
+ logger.info('reading files cache')
|
|
with open(os.path.join(self.path, 'files'), 'rb') as fd:
|
|
with open(os.path.join(self.path, 'files'), 'rb') as fd:
|
|
u = msgpack.Unpacker(use_list=True)
|
|
u = msgpack.Unpacker(use_list=True)
|
|
while True:
|
|
while True:
|