|
@@ -12,9 +12,6 @@ from .hashindex import ChunkIndex
|
|
|
class Cache(object):
|
|
|
"""Client Side cache
|
|
|
"""
|
|
|
- # Do not cache file metadata for files smaller than this
|
|
|
- FILE_MIN_SIZE = 4096
|
|
|
-
|
|
|
class RepositoryReplay(Error):
|
|
|
"""Cache is newer than repository, refusing to continue"""
|
|
|
|
|
@@ -84,9 +81,8 @@ class Cache(object):
|
|
|
break
|
|
|
u.feed(data)
|
|
|
for path_hash, item in u:
|
|
|
- if item[2] > self.FILE_MIN_SIZE:
|
|
|
- item[0] += 1
|
|
|
- self.files[path_hash] = msgpack.packb(item)
|
|
|
+ item[0] += 1
|
|
|
+ self.files[path_hash] = msgpack.packb(item)
|
|
|
|
|
|
def begin_txn(self):
|
|
|
# Initialize transaction snapshot
|
|
@@ -223,8 +219,7 @@ class Cache(object):
|
|
|
return None
|
|
|
|
|
|
def memorize_file(self, path_hash, st, ids):
|
|
|
- if st.st_size > self.FILE_MIN_SIZE:
|
|
|
- # Entry: Age, inode, size, mtime, chunk ids
|
|
|
- mtime_ns = st_mtime_ns(st)
|
|
|
- self.files[path_hash] = msgpack.packb((0, st.st_ino, st.st_size, mtime_ns, ids))
|
|
|
- self._newest_mtime = max(self._newest_mtime, mtime_ns)
|
|
|
+ # Entry: Age, inode, size, mtime, chunk ids
|
|
|
+ mtime_ns = st_mtime_ns(st)
|
|
|
+ self.files[path_hash] = msgpack.packb((0, st.st_ino, st.st_size, mtime_ns, ids))
|
|
|
+ self._newest_mtime = max(self._newest_mtime, mtime_ns)
|