mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 15:34:13 +00:00 
			
		
		
		
	Refactor
This commit is contained in:
		
							parent
							
								
									3dc2361654
								
							
						
					
					
						commit
						e3c0058942
					
				
					 1 changed files with 6 additions and 12 deletions
				
			
		
							
								
								
									
										18
									
								
								src/init.ts
									
										
									
									
									
								
							
							
						
						
									
										18
									
								
								src/init.ts
									
										
									
									
									
								
							| 
						 | 
					@ -1,16 +1,10 @@
 | 
				
			||||||
import { initDb } from './db/postgre';
 | 
					import { initDb } from './db/postgre';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function main() {
 | 
					console.log('Init database...');
 | 
				
			||||||
	try {
 | 
					 | 
				
			||||||
		console.log('Connecting database...');
 | 
					 | 
				
			||||||
		await initDb(false, true, true);
 | 
					 | 
				
			||||||
	} catch (e) {
 | 
					 | 
				
			||||||
		console.error('Cannot connect to database', null, true);
 | 
					 | 
				
			||||||
		console.error(e);
 | 
					 | 
				
			||||||
		process.exit(1);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					initDb(false, true, true).then(() => {
 | 
				
			||||||
	console.log('Done :)');
 | 
						console.log('Done :)');
 | 
				
			||||||
}
 | 
					}, e => {
 | 
				
			||||||
 | 
						console.error('Failed to init database');
 | 
				
			||||||
main();
 | 
						console.error(e);
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue