def doCommand(self, state, *args, **kw):
self.state = state
- id = self.state["site_refresh_id"]
+ site_id = self.state["site_id"]
q = """
- UPDATE site_refresh SET status = 'done', error = NULL where id = %s
+ UPDATE site_refresh SET status = 'done', error = NULL where site_id = %s
"""
- d = self.dcm.runQuery(q, [ id ])
+ d = self.dcm.runInteraction(self.newInteraction, q, [ site_id ])
d.addCallback(self.srDone)
d.addErrback(self.error)
except:
pass
- d = self.dcm.runQuery(q, (datetime.datetime.utcnow(),
+ d = self.dcm.runInteraction(self.newInteraction, q, (datetime.datetime.utcnow(),
self.state.get("download_etag", None),
self.state.get("download_last_modified", None),
entity_url,
d.addCallback(self.done)
d.addErrback(self.error)
+ def newInteraction(self, trans, *args):
+ trans.execute(*args)
+
def done(self, *args, **kw):
# return any new site_history_new_ids if we have them
retval = dict(site_history_new_ids = self.state.get("site_history_new_ids", []),