chb/smart_ui_server — pull request #2 by jmandel (2012-04-25 22:43:07+00:00)
Title: One possible fix for launch concurrency issues

django sessions can't (easily) be used for a function like `launch_app` which may execute multiple times in rapid succession and each instance attempts to add to the the django session. While storing tokens should be "append-only", django sessions glom together a whole bundle of relevant state in a single db blob (a pickled, base64-encoded python object).

So: one approach is to split this out into a small local model for storing tokens.

Issues:

* Do we want to store this state in the ui-server (not a huge departure from tokens already stored in the session, but we may want to move this over to smart-server nonetheless)

* Still need a `reset.sh` or equivalent (called by `smart_manager.py`) to clear and `python manage.py syncdb` on server rest.