## all done, didn't find it!!
self.finished=1
reactor.callFromThread(self.callback,[])
-
+
## get value
def goWithNodes(self, nodes, found=None):
self.results = {}
c = self.store.cursor()
s = "delete from kv where time < '%s';" % self.cut
c.execute(s)
- self.store.commit()
reactor.callLater(const.KE_DELAY, self.doExpire)
\ No newline at end of file
def loadDB(self, db):
try:
self.store = sqlite.connect(db=db)
+ self.store.autocommit = 1
except:
import traceback
raise KhashmirDBExcept, "Couldn't open DB", traceback.exc_traceback
def createNewDB(self, db):
self.store = sqlite.connect(db=db)
+ self.store.autocommit = 1
s = """
create table kv (key text, value text, time timestamp, primary key (key, value));
create index kv_key on kv(key);
"""
c = self.store.cursor()
c.execute(s)
- self.store.commit()
def render(self, request):
"""
# update last insert time
s = "update kv set time = '%s' where key = '%s' and value = '%s';" % (t, key, value)
c.execute(s)
- self.store.commit()
ip = self.crequest.getClientIP()
sender['host'] = ip
n = Node().initWithDict(sender)