q = """
UPDATE site_refresh set status = 'done', error = 'http_not_modified' where id = %s
"""
- d = self.dcm.runQuery(q, [ id ])
+ d = self.dcm.runInteraction(self.newInteraction, q, [ id ])
d.addCallback(self.modifiedUpdateDone)
d.addErrback(self.updateFailed)
return self.d
error = str(failure)
- d = self.dcm.runQuery(q, (error, id))
+ d = self.dcm.runInteraction(self.newInteraction, q, (error, id))
d.addCallback(self.updateDone)
d.addErrback(self.updateFailed)
q = """
UPDATE site SET last_poll = %s WHERE id = %s
"""
- d = self.dcm.runQuery(q, (datetime.datetime.utcnow(), site_id))
+ d = self.dcm.runInteraction(self.newInteraction, q, (datetime.datetime.utcnow(), site_id))
d.addCallback(self.updateDone)
d.addErrback(self.updateFailed)
+
+ def newInteraction(self, trans, *args):
+ trans.execute(*args)
+
def updateDone(self, *args, **kw):
if self.it_failed:
self.d.errback(self.orig_failure)