mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-22 08:50:07 +00:00
expirer: include crawler progress in the JSON status output
This commit is contained in:
@ -1731,6 +1731,12 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin):
|
|||||||
"(0 mutable / 0 immutable), 0 B (0 B / 0 B) "
|
"(0 mutable / 0 immutable), 0 B (0 B / 0 B) "
|
||||||
"but expiration was not enabled", s)
|
"but expiration was not enabled", s)
|
||||||
d.addCallback(_check_html)
|
d.addCallback(_check_html)
|
||||||
|
d.addCallback(lambda ign: self.render_json(webstatus))
|
||||||
|
def _check_json(json):
|
||||||
|
data = simplejson.loads(json)
|
||||||
|
self.failUnless("lease-checker" in data)
|
||||||
|
self.failUnless("lease-checker-progress" in data)
|
||||||
|
d.addCallback(_check_json)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def backdate_lease(self, sf, renew_secret, new_expire_time):
|
def backdate_lease(self, sf, renew_secret, new_expire_time):
|
||||||
|
@ -29,6 +29,7 @@ class StorageStatus(rend.Page):
|
|||||||
d = {"stats": self.storage.get_stats(),
|
d = {"stats": self.storage.get_stats(),
|
||||||
"bucket-counter": self.storage.bucket_counter.get_state(),
|
"bucket-counter": self.storage.bucket_counter.get_state(),
|
||||||
"lease-checker": self.storage.lease_checker.get_state(),
|
"lease-checker": self.storage.lease_checker.get_state(),
|
||||||
|
"lease-checker-progress": self.storage.lease_checker.get_progress(),
|
||||||
}
|
}
|
||||||
return simplejson.dumps(d, indent=1) + "\n"
|
return simplejson.dumps(d, indent=1) + "\n"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user