local-llm-server/other/gunicorn.py

21 lines
440 B
Python
Raw Normal View History

"""
This file is used to run certain tasks when the HTTP server starts.
It's located here so it doesn't get imported with daemon.py
"""
2023-10-30 14:42:50 -06:00
from llm_server.logging import create_logger
2023-09-26 13:32:33 -06:00
try:
import gevent.monkey
gevent.monkey.patch_all()
except ImportError:
pass
from llm_server.pre_fork import server_startup
2023-09-26 13:32:33 -06:00
def on_starting(s):
server_startup(s)
2023-10-30 14:42:50 -06:00
logger = create_logger('gunicorn')
logger.info('Startup complete!')