]> git.etc.gen.nz Git - whoisi.git/commitdiff
Update to use PostgreSQL and runInteraction.
authorAndrew Ruthven <andrew@etc.gen.nz>
Mon, 22 Jun 2009 20:59:13 +0000 (08:59 +1200)
committerAndrew Ruthven <andrew@cerberus.etc.gen.nz>
Mon, 22 Jun 2009 20:59:13 +0000 (08:59 +1200)
services/master/refreshmanager.py

index 5083aca6951edaf5a5a6edc16cb1690b023769d8..cb4ce0e9114da34892fe013b10cccf1ba98b201f 100644 (file)
@@ -73,7 +73,7 @@ class RefreshManager:
         q = """
             SELECT id, url, last_poll from site where is_removed is null and id > %s
             """
-        d = self.master.database_manager.runQuery(q, self.site_check_last_id)
+        d = self.master.database_manager.runQuery(q, [ self.site_check_last_id ])
         d.addCallback(self.gotNewSites)
         d.addErrback(self.newSitesError)
 
@@ -130,9 +130,13 @@ class RefreshManager:
         q = """
             INSERT INTO site_refresh values (NULL, %s, "new", NULL)
             """
-        d = self.master.database_manager.runQuery(q, site.id)
+        d = self.master.database_manager.runQuery(self.newInteraction, q, [ site.id ])
         d.addErrback(self.error)
 
+    def newInteraction(self, trans, *args):
+        trans.execute(*args)
+        return true
+
     def error(self, failure):
         print("error: %s" % failure.getErrorMessage())