kore

Kore is a web application platform for writing scalable, concurrent web based processes in C or Python.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit bb210db3dff2896b18fe508eb97c8248dd4a45fb
parent a35dfc6d06f3ce4ba22e2a3d256283ffda24075a
Author: Joris Vink <joris@coders.se>
Date:   Tue, 10 Apr 2018 18:26:22 +0200

let pyko skeletons setup 'appdb' if available.

If a worker can pickup PYKO_CONNINFO from the environment it will register a
new pgsql connection called 'appdb' tied to the given connection string.

Diffstat:
src/cli.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/cli.c b/src/cli.c @@ -345,7 +345,12 @@ static const char *pyko_init_data = "if port is None:\n" "\tport = '8888'\n" "\n" - "kore.listen(ip, port, '')\n"; + "kore.listen(ip, port, '')\n" + "\n" + "def kore_worker_configure():\n" + "\tconninfo = os.getenv('PYKO_CONNINFO')\n" + "\tif conninfo is not None:\n" + "\t\tkore.register_database('appdb', conninfo)\n"; static const char *pyko_handlers_data = "import kore\n"