play nice with subclasses

This commit is contained in:
meejah 2021-10-24 22:27:59 -06:00
parent 758dcea2d4
commit f7b385f954

View File

@ -248,8 +248,12 @@ class ShareCrawler(service.MultiService):
last_complete_prefix = self.prefixes[lcpi]
self.state["last-complete-prefix"] = last_complete_prefix
tmpfile = self.statefile + ".tmp"
# Note: we use self.get_state() here because e.g
# LeaseCheckingCrawler stores non-JSON-able state in
# self.state() but converts it in self.get_state()
with open(tmpfile, "wb") as f:
json.dump(self.state, f)
json.dump(self.get_state(), f)
fileutil.move_into_place(tmpfile, self.statefile)
def startService(self):