mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Add open/close API for context
This commit is contained in:
		| @@ -17,11 +17,10 @@ | ||||
| var JsonDB = require('node-json-db'); | ||||
| var fs = require('fs-extra'); | ||||
| var path = require("path"); | ||||
| var when = require("when"); | ||||
|  | ||||
| function createStorage(storageBaseDir, scope) { | ||||
|     var i = scope.indexOf(":") | ||||
|      | ||||
|     if(i === -1){ | ||||
|     if(scope.indexOf(":") === -1){ | ||||
|         if(scope === "global"){ | ||||
|             return new JsonDB(path.join(storageBaseDir,"global",scope), true, true);  | ||||
|         }else{ // scope:flow | ||||
| @@ -69,6 +68,14 @@ function LocalFileSystem(config){ | ||||
|     this.storages = {}; | ||||
| } | ||||
|  | ||||
| LocalFileSystem.prototype.open = function(){ | ||||
|     return when.resolve(); | ||||
| } | ||||
|  | ||||
| LocalFileSystem.prototype.close = function(){ | ||||
|     return when.resolve(); | ||||
| } | ||||
|  | ||||
| LocalFileSystem.prototype.get = function (scope, key) { | ||||
|     if(!this.storages[scope]){ | ||||
|         return undefined; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user