Update message counts when finished crawling lists

This commit is contained in:
Magnus Hagander
2012-01-22 21:58:03 +01:00
parent 81fedf6def
commit 621e55f532

View File

@ -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)