From b3898b39e59e0f7f464ebc24e7068da4e75a091f Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Wed, 24 Jun 2009 12:16:17 +1200 Subject: [PATCH] Use runInteraction for some more queries. --- services/command/siterefresh.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/command/siterefresh.py b/services/command/siterefresh.py index 4f96665..c1e7f70 100644 --- a/services/command/siterefresh.py +++ b/services/command/siterefresh.py @@ -105,7 +105,7 @@ class RefreshSiteError: 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 @@ -116,7 +116,7 @@ class RefreshSiteError: 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) @@ -128,10 +128,14 @@ class RefreshSiteError: 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) -- 2.30.2