Discussion:
[bottlepy] Re-initialise Bottle at runtime?
Alec Taylor
2015-05-19 13:16:51 UTC
Permalink
I am using the bottle-peewee plugin, with a `db` variable initialised
in my root __init__.py.

Peewee-SQL is giving me a "connection already closed" message when:

0) bottle is started
1) database server is stopped
2) model endpoint hit
3) error thrown
4) database server started
5) model endpoint hit
6) "connection already closed" error thrown

Currently I can catch the `peewee.InterfaceError` exception, and once
I'm there I try running:

global db
db = PeeweePlugin(environ['RDBMS_URI'])

But that doesn't remove the error.

How do I re-initialise Bottle? - Equivalent to stopping bottle and
starting it again, like the reloader does on file-change.

Thanks for all suggestions
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...