@pioneer-platform/default-redis 8.11.1 → 8.11.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.
- package/CHANGELOG.md +12 -0
- package/index.js +11 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @pioneer-platform/default-redis
|
|
2
2
|
|
|
3
|
+
## 8.11.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix: add TLS support and increase timeouts for remote Redis connections (rediss://)
|
|
8
|
+
|
|
9
|
+
## 8.11.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fix: enable Redis offline queue to prevent startup crashes
|
|
14
|
+
|
|
3
15
|
## 8.11.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/index.js
CHANGED
|
@@ -26,7 +26,7 @@ const redisConfig = {
|
|
|
26
26
|
keepAlive: 5000, // TCP keep-alive interval
|
|
27
27
|
maxRetriesPerRequest: 3, // Increased from 1 to 3 - allow retries for transient network issues
|
|
28
28
|
enableReadyCheck: true,
|
|
29
|
-
enableOfflineQueue:
|
|
29
|
+
enableOfflineQueue: true, // Queue commands when disconnected to prevent crashes during startup
|
|
30
30
|
retryStrategy(times) {
|
|
31
31
|
const delay = Math.min(times * 50, 2000);
|
|
32
32
|
console.log(TAG, `Redis reconnect attempt ${times} in ${delay}ms`);
|
|
@@ -45,12 +45,20 @@ if (process.env.REDIS_CONNECTION) {
|
|
|
45
45
|
port: parseInt(connUrl.port) || 6379,
|
|
46
46
|
password: connUrl.password || undefined,
|
|
47
47
|
username: (connUrl.username && connUrl.username !== 'default') ? connUrl.username : undefined,
|
|
48
|
+
// Add TLS support for rediss:// connections
|
|
49
|
+
tls: connUrl.protocol === 'rediss:' ? {
|
|
50
|
+
rejectUnauthorized: false // Required for DigitalOcean managed Redis
|
|
51
|
+
} : undefined,
|
|
52
|
+
// Increase timeouts for remote connections
|
|
53
|
+
connectTimeout: 30000, // 30 seconds for remote SSL connections
|
|
54
|
+
commandTimeout: 30000, // 30 seconds for remote commands
|
|
48
55
|
});
|
|
49
56
|
|
|
50
|
-
console.log(TAG, "Merged config
|
|
57
|
+
console.log(TAG, "Merged config:", {
|
|
51
58
|
host: redisConfig.host,
|
|
52
59
|
port: redisConfig.port,
|
|
53
|
-
|
|
60
|
+
protocol: connUrl.protocol,
|
|
61
|
+
tls: !!redisConfig.tls,
|
|
54
62
|
connectTimeout: redisConfig.connectTimeout,
|
|
55
63
|
commandTimeout: redisConfig.commandTimeout
|
|
56
64
|
});
|