mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-11-01 07:43:02 +00:00 
			
		
		
		
	Handle race in database creation when running multiple WSGI instances
This commit is contained in:
		
							
								
								
									
										10
									
								
								cps/ub.py
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								cps/ub.py
									
									
									
									
									
								
							| @@ -161,6 +161,10 @@ Session.configure(bind=engine) | ||||
| session = Session() | ||||
|  | ||||
| if not os.path.exists(dbpath): | ||||
| 	Base.metadata.create_all(engine) | ||||
| 	create_default_config() | ||||
| 	create_admin_user() | ||||
| 	try: | ||||
| 		Base.metadata.create_all(engine) | ||||
| 		create_default_config() | ||||
| 		create_admin_user() | ||||
| 	except Exception: | ||||
| 		pass | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 JanB
					JanB