browsertrix/backend/btrixcloud/main_op.py
Ilya Kreymer 7aefe09581
startup fixes: (#793)
- don't run migrations on first init, just set to CURR_DB_VERSION
- implement 'run once lock' with mkdir/rmdir
- move register_exit_handler() to utils
- remove old run once handler
2023-04-24 18:32:52 -07:00

25 lines
524 B
Python

""" entrypoint module for operator """
from fastapi import FastAPI
from .operator import init_operator_webhook
from .utils import register_exit_handler
app_root = FastAPI()
# ============================================================================
def main():
"""main init"""
init_operator_webhook(app_root)
# ============================================================================
@app_root.on_event("startup")
async def startup():
"""init on startup"""
register_exit_handler()
main()