server: make gunicorn friendly
This commit is contained in:
parent
6b42d787a7
commit
e5f250260d
|
@ -10,7 +10,7 @@ import argparse
|
|||
import os.path
|
||||
import sys
|
||||
import waitress
|
||||
from szurubooru.facade import create_app
|
||||
from szurubooru.facade import app
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser('Starts szurubooru using waitress.')
|
||||
|
@ -19,7 +19,6 @@ def main():
|
|||
parser.add_argument('--host', help='IP to listen on', default='0.0.0.0')
|
||||
args = parser.parse_args()
|
||||
|
||||
app = create_app()
|
||||
waitress.serve(app, host=args.host, port=args.port)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -113,3 +113,6 @@ def create_app():
|
|||
rest.errors.handle(sqlalchemy.orm.exc.StaleDataError, _on_stale_data_error)
|
||||
|
||||
return rest.application
|
||||
|
||||
|
||||
app = create_app()
|
||||
|
|
Loading…
Reference in New Issue