From: Andrew Ruthven Date: Mon, 22 Jun 2009 20:59:13 +0000 (+1200) Subject: Update to use PostgreSQL and runInteraction. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6ce8e672de0dba51b84b6e0d0dd4444edc1b031;p=whoisi.git Update to use PostgreSQL and runInteraction. --- diff --git a/services/master/refreshmanager.py b/services/master/refreshmanager.py index 5083aca..cb4ce0e 100644 --- a/services/master/refreshmanager.py +++ b/services/master/refreshmanager.py @@ -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())