mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-30 16:13:58 +00:00
0dee2a6036
This walks slowly through all shares, examining their leases, deciding which are still valid and which have expired. Once enabled, it will then remove the expired leases, and delete shares which no longer have any valid leases. Note that there is not yet a tahoe.cfg option to enable lease-deletion: the current code is read-only. A subsequent patch will add a tahoe.cfg knob to control this, as well as docs. Some other minor items included in this patch: tahoe debug dump-share has a new --leases-only flag storage sharefile/leaseinfo code is cleaned up storage web status page (/storage) has more info, more tests coverage space-left measurement on OS-X should be more accurate (it was off by 2048x) (use stat .f_frsize instead of f_bsize)
15 lines
340 B
Python
15 lines
340 B
Python
#! /usr/bin/python
|
|
|
|
from mutable import MutableShareFile
|
|
from immutable import ShareFile
|
|
|
|
def get_share_file(filename):
|
|
f = open(filename, "rb")
|
|
prefix = f.read(32)
|
|
f.close()
|
|
if prefix == MutableShareFile.MAGIC:
|
|
return MutableShareFile(filename)
|
|
# otherwise assume it's immutable
|
|
return ShareFile(filename)
|
|
|