applay-utils 1.9.2 → 1.9.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/mdb.js +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applay-utils",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "Utilitary tools for Applay applications",
5
5
  "scripts": {
6
6
  "build": "npm version patch",
package/utils/mdb.js CHANGED
@@ -69,7 +69,12 @@ var connect = (alias, url, callback, onError) => {
69
69
  console.log('===============>>>>>>> NOVO POOL DE CONEXÃO MDB ', url, alias);
70
70
 
71
71
  const separator = url.includes('?') ? '&' : '/?';
72
- const uriparams = `${separator}appName=${alias}&minPoolSize=2&maxPoolSize=10&maxIdleTimeMS=30000&serverSelectionTimeoutMS=5000`;
72
+ // maxIdleTimeMS baixo (30s) fazia o pool destruir e recriar as conexões
73
+ // mínimas (minPoolSize) a cada ~30s, 24h/dia, mesmo sem tráfego — gerando
74
+ // uma quantidade enorme de eventos NETWORK de conexão/handshake no log do
75
+ // mongod (centenas de MB/dia). 10 minutos mantém o benefício de conexões
76
+ // "quentes" sem esse churn constante.
77
+ const uriparams = `${separator}appName=${alias}&minPoolSize=2&maxPoolSize=10&maxIdleTimeMS=600000&serverSelectionTimeoutMS=5000`;
73
78
 
74
79
  registerShutdownHandlersOnce();
75
80