mozilla/kitsune — pull request #421 by willkg (2012-01-05 23:02:01+00:00)
Title: [bug 715536] Multi-index-task squashing

Incremental updatie (not delete!) tasks all get tossed in a thread-local
queue. At request_finished, there's a handler that creates tasks from the
queued tasks. Because the queue is a set, this removes task duplicates
so we're only creating one index task per request per document.

This also fixes refresh calls so they pass timesleep=0--we don't need to
wait for a second to update the index.

I've never done thread-local stuff before. I think I got it right, but it's worth double-checking.

Also, I added explicit self.refresh() calls to tests, but that refresh should get renamed to "update_index" or something like that since it's a refresh call (which is probably superfluous) and a generate_tasks call (which is definitely not superfluous). I can do that tomorrow in a cleanup pass.

r?