]> git.etc.gen.nz Git - whoisi.git/commitdiff
More MySQLisms.
authorAndrew Ruthven <andrew@etc.gen.nz>
Tue, 23 Jun 2009 03:37:33 +0000 (15:37 +1200)
committerAndrew Ruthven <andrew@cerberus.etc.gen.nz>
Tue, 23 Jun 2009 03:37:33 +0000 (15:37 +1200)
services/command/newsite.py
services/command/siterefresh.py

index 57e87e1d7e6dd23f9eda3ae3266438939f3f977b..a13f6bc236e51b9680d4537e9deac03c92a09ddb 100644 (file)
@@ -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)
index f2b83eafd563d38eb1a1a83cd0962df48b288e98..4f966659020ee68f0c54d02a5118a17dc04d9357 100644 (file)
@@ -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", []),