]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_dht_Khashmir/actions.py
Move all the khashmir database operations to a separate module.
[quix0rs-apt-p2p.git] / apt_dht_Khashmir / actions.py
index 7f8f91128b3e7360ce0cb6811a5a7f06f3b675c2..4214e4eb932580230aa0552a5270d86eba10b124 100644 (file)
@@ -263,13 +263,7 @@ class KeyExpirer:
         self.next_expire = reactor.callLater(self.config['KEINITIAL_DELAY'], self.doExpire)
     
     def doExpire(self):
-        self.cut = "%0.6f" % (time() - self.config['KE_AGE'])
-        self._expire()
-    
-    def _expire(self):
-        c = self.store.cursor()
-        s = "delete from kv where time < '%s';" % self.cut
-        c.execute(s)
+        self.store.expireValues(time() - self.config['KE_AGE'])
         self.next_expire = reactor.callLater(self.config['KE_DELAY'], self.doExpire)
         
     def shutdown(self):