- 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
		
			
				
	
	
		
			25 lines
		
	
	
		
			524 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			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()
 |