Change all unittests to use twisted's trial.
[quix0rs-apt-p2p.git] / apt_dht_Khashmir / actions.py
index dc743de2e7658bcb2e598bc3ccb503964b702c6c..a3a6fc84e5d6ac1f836a4fd9deb1984790c58a75 100644 (file)
@@ -260,7 +260,7 @@ class KeyExpirer:
     def __init__(self, store, config):
         self.store = store
         self.config = config
-        reactor.callLater(self.config['KEINITIAL_DELAY'], self.doExpire)
+        self.next_expire = reactor.callLater(self.config['KEINITIAL_DELAY'], self.doExpire)
     
     def doExpire(self):
         self.cut = "%0.6f" % (time() - self.config['KE_AGE'])
@@ -270,4 +270,4 @@ class KeyExpirer:
         c = self.store.cursor()
         s = "delete from kv where time < '%s';" % self.cut
         c.execute(s)
-        reactor.callLater(self.config['KE_DELAY'], self.doExpire)
+        self.next_expire = reactor.callLater(self.config['KE_DELAY'], self.doExpire)