@ladjs/shared-config
Advanced tools
+25
-1
@@ -10,2 +10,3 @@ const fs = require('fs'); | ||
| // eslint-disable-next-line complexity | ||
| function sharedConfig(prefix, env = process.env.NODE_ENV || 'development') { | ||
@@ -105,3 +106,26 @@ prefix = prefix.toUpperCase(); | ||
| process.env[`${prefix}_REDIS_SHOW_FRIENDLY_ERROR_STACK`] | ||
| ) | ||
| ), | ||
| // | ||
| // NOTE: we override default values in ioredis for `maxRetriesPerRequest` | ||
| // and also `maxLoadingRetryTime`, because otherwise the default values | ||
| // of 20 * 10000 would cause 200s retry time, which is more than the | ||
| // HTTP default timeout per request of 30s as per above, and we use | ||
| // sensible default values of 3 * 3000 = 9s max redis retry time | ||
| // | ||
| // default in ioredis is 20 | ||
| maxRetriesPerRequest: process.env[ | ||
| `${prefix}_REDIS_MAX_RETRIES_PER_REQUEST` | ||
| ] | ||
| ? Number.parseInt( | ||
| process.env[`${prefix}_REDIS_MAX_RETRIES_PER_REQUEST`], | ||
| 10 | ||
| ) | ||
| : 3, | ||
| // default in ioredis is 10000 (10s) | ||
| maxLoadingRetryTime: process.env[`${prefix}_REDIS_MAX_LOADING_RETRY_TIME`] | ||
| ? Number.parseInt( | ||
| process.env[`${prefix}_REDIS_MAX_LOADING_RETRY_TIME`], | ||
| 10 | ||
| ) | ||
| : 3000 | ||
| }, | ||
@@ -108,0 +132,0 @@ redisMonitor: boolean(process.env[`${prefix}_REDIS_MONITOR`]), |
+2
-2
| { | ||
| "name": "@ladjs/shared-config", | ||
| "description": "Shared configuration for Lad's API and Web servers", | ||
| "version": "6.0.2", | ||
| "version": "7.0.0", | ||
| "author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)", | ||
@@ -37,3 +37,3 @@ "ava": { | ||
| "husky": "^8.0.1", | ||
| "lint-staged": "^12.4.2", | ||
| "lint-staged": "^12.4.3", | ||
| "nyc": "^15.1.0", | ||
@@ -40,0 +40,0 @@ "remark-cli": "^10.0.1", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
11709
9.22%160
17.65%41
10.81%