From 0858f1723c08befcb3d30d5e4e8cd62941d29b78 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Tue, 23 Jun 2009 15:37:33 +1200 Subject: [PATCH] More MySQLisms. --- services/command/newsite.py | 1 - services/command/siterefresh.py | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/services/command/newsite.py b/services/command/newsite.py index 57e87e1..a13f6bc 100644 --- a/services/command/newsite.py +++ b/services/command/newsite.py @@ -619,7 +619,6 @@ class NewSiteError: def newInteraction(self, trans, *args): trans.execute(*args) - return trans.lastrowid def updateDoneError(self, *args, **kw): self.d.errback(self.orig_failure) diff --git a/services/command/siterefresh.py b/services/command/siterefresh.py index f2b83ea..4f96665 100644 --- a/services/command/siterefresh.py +++ b/services/command/siterefresh.py @@ -40,11 +40,11 @@ class RefreshSiteDone(BaseCommand): 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) @@ -63,7 +63,7 @@ class RefreshSiteDone(BaseCommand): 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, @@ -71,6 +71,9 @@ class RefreshSiteDone(BaseCommand): 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", []), -- 2.30.2