mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	Bail if unable to connect to db
This commit is contained in:
		
							parent
							
								
									c3ad38cd33
								
							
						
					
					
						commit
						0612f23b36
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		
							
								
								
									
										5
									
								
								db.js
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								db.js
									
										
									
									
									
								
							|  | @ -467,7 +467,10 @@ module.exports.CreateDB = function (parent, func) { | |||
|         // Set the default database for the rest of this connections lifetime
 | ||||
|         var useDatabase = 'USE ' + dbname; | ||||
|         sqlDbQuery(useDatabase, null, function (err, docs) { | ||||
|             if (err != null) { console.log(err); parent.debug('db', 'ERROR: ' + useDatabase + ': ' + err); } | ||||
|             if (err != null) { | ||||
|                 console.log("Unable to connect to database: " + err); | ||||
|                 process.exit(); | ||||
|             } | ||||
|             if (err == null) { | ||||
|                 parent.debug('db', 'Checking tables...'); | ||||
|                 sqlDbBatchExec([ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue