aboutsummaryrefslogtreecommitdiffstats
path: root/gunicorn_config.py
blob: e4b661358320b790b35e196c243b9db2d09ed7bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
# coding=utf-8
def when_ready(server):
    """ server hook that only runs when the gunicorn master process loads """

    server.log.info("Creating tables...")

    from pysite.database import RethinkDB

    db = RethinkDB(loop_type=None)
    created = db.create_tables()

    server.log.info(f"Created {created} tables.")