##// END OF EJS Templates
feat(archive-cache): re-calculate size better if we miss it in stats
super-admin -
r5425:9c658c9d default
parent child Browse files
Show More
@@ -331,21 +331,25 b' class FanoutCache:'
331 331 key_file_path = os.path.join(shard._directory, key_file)
332 332 with open(key_file_path, 'rb') as f:
333 333 metadata = json.loads(f.read())
334
335 size = metadata.get('size')
336 filename = metadata.get('filename')
337 full_path = metadata.get('full_path')
338
339 if not size:
334 340 # in case we don't have size re-calc it...
335 if not metadata.get('size'):
336 fn = metadata.get('full_path')
337 size = os.stat(fn).st_size
341 size = os.stat(full_path).st_size
338 342
339 343 data.append([
340 344 cnt,
341 345 key_file,
342 346 key_file_path,
343 metadata.get('filename'),
344 metadata.get('full_path'),
347 filename,
348 full_path,
345 349 metadata.get('store_time', 0),
346 350 metadata.get('access_time', 0),
347 351 metadata.get('access_count', 0),
348 metadata.get('size', size),
352 size,
349 353 ])
350 354 cnt += 1
351 355
General Comments 0
You need to be logged in to leave comments. Login now