|  |  |  | @ -8,7 +8,8 @@ const config = require('./config'); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | let storageProfile; | 
		
	
		
			
				|  |  |  |  | const { NODE_ENV: environment, NODE_APP_INSTANCE:instance } = process.env; | 
		
	
		
			
				|  |  |  |  | const isProduction = environment === 'production' && !instance; | 
		
	
		
			
				|  |  |  |  | const isValidInstance = instance && instance.length > 0; | 
		
	
		
			
				|  |  |  |  | const isProduction = environment === 'production' && !isValidInstance; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | // Use seperate data directories for each different environment and app instances
 | 
		
	
		
			
				|  |  |  |  | // We should prioritise config values first
 | 
		
	
	
		
			
				
					|  |  |  | @ -16,7 +17,7 @@ if (config.has(storageProfile)) { | 
		
	
		
			
				|  |  |  |  |   storageProfile = config.get('storageProfile'); | 
		
	
		
			
				|  |  |  |  | } else if (!isProduction) { | 
		
	
		
			
				|  |  |  |  |   storageProfile = environment; | 
		
	
		
			
				|  |  |  |  |   if (instance) { | 
		
	
		
			
				|  |  |  |  |   if (isValidInstance) { | 
		
	
		
			
				|  |  |  |  |     storageProfile = storageProfile.concat(`-${instance}`) | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | } | 
		
	
	
		
			
				
					|  |  |  | 
 |