eevee/spline-pokedex — Issue #57: Stop rebuilding Pokédex index on startup
Author: encukou
Created: 2012-01-26 22:40:50+00:00
State: open
Labels: core

**Reported by [Eevee](http://github.com/eevee) on 2011/04/22 04:47:46 +0000 · Migrated from [Redmine issue 585](http://bugs.veekun.com/issues/585)**

---

Seems that with gunicorn, two threads try to create the index at the same time, and I end up with one empty index and one junk index that actually contains all the speller data. Orrr something; not quite sure what’s going on here.

Regardless, this is very surprising and quiet behavior; if we’re going to require that the deployer use \`pokedex load\` then there’s no reason not to make ’em use \`reindex\` as well. Perhaps we should warn if it looks like these haven’t been done.

Redmine metadata:
Updated on: 2011/04/22 12:26:53 +0000
Start date: 2011/04/22

---

**Comment by [En-Cu-Kou](http://github.com/encukou) from 2011/04/22 12:26:53 +0000**

Why just warn, not die?
Maybe PokedexLookup itself should explode when the index doesn’t exist (or match the database, ideally), and rebuild\_index should just be moved out of the class (or become an “alternate constructor” classmethod).