forked from OpenWF/SpaceNinjaServer
		
	fix: sync config with db only after connection is established (#2346)
The error message had regressed in the case where connection could not be established. Reviewed-on: OpenWF/SpaceNinjaServer#2346 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									58bdb2d2ec
								
							
						
					
					
						commit
						00cea6788e
					
				@ -28,12 +28,13 @@ import { updateWorldStateCollections } from "./services/worldStateService";
 | 
			
		||||
JSON.stringify = JSONStringify;
 | 
			
		||||
 | 
			
		||||
validateConfig();
 | 
			
		||||
syncConfigWithDatabase();
 | 
			
		||||
 | 
			
		||||
mongoose
 | 
			
		||||
    .connect(config.mongodbUrl)
 | 
			
		||||
    .then(() => {
 | 
			
		||||
        logger.info("Connected to MongoDB");
 | 
			
		||||
        syncConfigWithDatabase();
 | 
			
		||||
 | 
			
		||||
        startWebServer();
 | 
			
		||||
 | 
			
		||||
        void updateWorldStateCollections();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user