godprotocol 2.3.16 → 2.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ class Services {
|
|
|
34
34
|
constructor() {
|
|
35
35
|
this.services = new Object();
|
|
36
36
|
|
|
37
|
-
this.
|
|
37
|
+
this.dbs = new Object();
|
|
38
38
|
this.load_services(gp_services);
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -154,23 +154,18 @@ class Services {
|
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
platform_db = async () => {
|
|
157
|
-
let prefix = this.db_prefix
|
|
158
|
-
|
|
157
|
+
let prefix = this.db_prefix,
|
|
158
|
+
name = this.db_name || this.db_config.name;
|
|
159
|
+
|
|
159
160
|
if (prefix) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
let conf = { ...this.db_config };
|
|
163
|
-
conf.name = `${prefix}:${this.db_config.name}`;
|
|
161
|
+
name = `${prefix}:${name}`;
|
|
162
|
+
}
|
|
164
163
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if (!db) {
|
|
171
|
-
db = new DB(this.db_config, this);
|
|
172
|
-
this.db = db;
|
|
173
|
-
}
|
|
164
|
+
let db = this.dbs[name];
|
|
165
|
+
if (!db) {
|
|
166
|
+
db = new DB({ ...this.db_config, name }, this);
|
|
167
|
+
|
|
168
|
+
this.dbs[name] = db;
|
|
174
169
|
}
|
|
175
170
|
|
|
176
171
|
return db;
|