pangea-server 3.3.94 → 3.3.96
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/dist/database/db-client.js +2 -1
- package/dist/database/db.class.js +17 -12
- package/package.json +1 -1
|
@@ -17,7 +17,8 @@ function initDatabase(models, seeds, config = {}) {
|
|
|
17
17
|
username: (0, helpers_1.getEnvStr)('DB_USERNAME'),
|
|
18
18
|
password: (0, helpers_1.getEnvStr)('DB_PASSWORD'),
|
|
19
19
|
database: (0, helpers_1.getEnvStr)('DB_DATABASE'),
|
|
20
|
-
pool: { max:
|
|
20
|
+
pool: { max: 5, min: 0, acquire: 30000, idle: 15000, evict: 5000 },
|
|
21
|
+
timezone: '+00:00',
|
|
21
22
|
models: Object.values(models),
|
|
22
23
|
logging: config.logging ? logQuery : false,
|
|
23
24
|
benchmark: true,
|
|
@@ -305,18 +305,23 @@ function getFinalOrder(order, config = {}) {
|
|
|
305
305
|
return [...finalOrder, ...(!config.attributes ? [['createdAt', 'DESC']] : [])];
|
|
306
306
|
}
|
|
307
307
|
function processInstance(model, instance) {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
308
|
+
// ----------------------
|
|
309
|
+
// TODO
|
|
310
|
+
// No necesito esto ahora pero cuando lo active
|
|
311
|
+
// porque agregue el "instance.init?.(lang)"
|
|
312
|
+
// hay varios virtuals de relaciones que se van a romper.
|
|
313
|
+
// Ejemplo: amountInClientCoin en Asset de Spendix
|
|
314
|
+
// ----------------------
|
|
315
|
+
// for (const [relName] of Object.entries(model.Relations)) {
|
|
316
|
+
// const relInstance = (instance as any)[relName];
|
|
317
|
+
// if (!relInstance) continue;
|
|
318
|
+
// const relModel = model.Relations[relName].getModelFn();
|
|
319
|
+
// if (Array.isArray(relInstance)) {
|
|
320
|
+
// relInstance.forEach((instance) => processInstance(relModel, instance));
|
|
321
|
+
// } else {
|
|
322
|
+
// processInstance(relModel, relInstance);
|
|
323
|
+
// }
|
|
324
|
+
// }
|
|
320
325
|
return instance.toJSON();
|
|
321
326
|
}
|
|
322
327
|
function processInstances(model, instances) {
|