From a6ce8e672de0dba51b84b6e0d0dd4444edc1b031 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Tue, 23 Jun 2009 08:59:13 +1200 Subject: [PATCH] Update to use PostgreSQL and runInteraction. --- services/master/refreshmanager.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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()) -- 2.30.2