X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=lbs.py;h=507b9e13bcef1fb5ec078637ed1f95d588ca9245;hb=048815121720c9cfb0bc8df48efd9aa0c846e3d0;hp=4224cf93dd2141052f4f48c34362ca62ac59130c;hpb=030ddd80e04aa65738bf21557dd541bec757de5b;p=cumulus.git diff --git a/lbs.py b/lbs.py index 4224cf9..507b9e1 100644 --- a/lbs.py +++ b/lbs.py @@ -263,7 +263,7 @@ def parse(lines, terminate=None): last_key = None continue - m = re.match(r"^(\w+):\s*(.*)$", l) + m = re.match(r"^([-\w]+):\s*(.*)$", l) if m: dict[m.group(1)] = m.group(2) last_key = m.group(1) @@ -541,6 +541,11 @@ class LocalDatabase: where expire_time < ?)""", (last_snapshotid,)) + # Remove sub-block signatures for deleted objects. + cur.execute("""delete from subblock_signatures + where blockid not in + (select blockid from block_index)""") + # Segment cleaning. class SegmentInfo(Struct): pass @@ -564,7 +569,8 @@ class LocalDatabase: cur = self.cursor() segments = [] cur.execute("""select segmentid, used, size, mtime, - julianday('now') - mtime as age from segment_info""") + julianday('now') - mtime as age from segment_info + where expire_time is null""") for row in cur: info = self.SegmentInfo() info.id = row[0]