mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Add simple caching of env var lookup
This commit is contained in:
		| @@ -110,6 +110,10 @@ | ||||
|     } | ||||
|  | ||||
|     function getEnvVars (obj, envVars = {}) { | ||||
|         contextKnownKeys.env = contextKnownKeys.env || {} | ||||
|         if (contextKnownKeys.env[obj.id]) { | ||||
|             return contextKnownKeys.env[obj.id] | ||||
|         } | ||||
|         let parent | ||||
|         if (obj.type === 'tab' || obj.type === 'subflow') { | ||||
|             RED.nodes.eachConfig(function (conf) { | ||||
| @@ -130,9 +134,10 @@ | ||||
|                 envVars[env.name] = obj | ||||
|             }) | ||||
|         } | ||||
|         contextKnownKeys.env[obj.id] = envVars | ||||
|         return envVars | ||||
|     } | ||||
|     RED.pp = getEnvVars | ||||
|  | ||||
|     const envAutoComplete = function (val) { | ||||
|         const editStack = RED.editor.getEditStack() | ||||
|         if (editStack.length === 0) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user