From 621e55f53277d8e8afc10ad4f22f5f3434a6048a Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sun, 22 Jan 2012 21:58:03 +0100 Subject: [PATCH] Update message counts when finished crawling lists --- tools/search/crawler/listcrawler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/search/crawler/listcrawler.py b/tools/search/crawler/listcrawler.py index 02091284..03621f3a 100755 --- a/tools/search/crawler/listcrawler.py +++ b/tools/search/crawler/listcrawler.py @@ -29,6 +29,9 @@ def doit(opt): listinfo = [(id,name) for id,name in curs.fetchall()] c = MultiListCrawler(listinfo, conn, opt.status_interval, opt.commit_interval) n = c.crawl(opt.full, opt.month) + + # Update total counts + curs.execute("WITH t AS (SELECT list,count(*) AS c FROM messages GROUP BY list) UPDATE lists SET pagecount=t.c FROM t WHERE id=t.list") conn.commit() log("Indexed %s messages" % n)