aboutsummaryrefslogtreecommitdiffstats
path: root/gunicorn_config.py
blob: 7e17b0ccdc9d523303947dd0c290b28f41b6ca27 (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 """

    print("Creating tables...")

    from pysite.database import RethinkDB

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

    print(f"Created {created} tables.")