@mulingai-npm/redis 3.40.5 → 3.40.6
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.
|
@@ -19,7 +19,7 @@ export interface ContextEnhancerResult {
|
|
|
19
19
|
export declare class ContextEnhancerManager {
|
|
20
20
|
private redisClient;
|
|
21
21
|
private ttlSeconds;
|
|
22
|
-
constructor(redisClient: RedisClient
|
|
22
|
+
constructor(redisClient: RedisClient);
|
|
23
23
|
private key;
|
|
24
24
|
/** Get TTL configured for this environment (in seconds) */
|
|
25
25
|
getTtlSeconds(): number;
|
|
@@ -14,16 +14,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.ContextEnhancerManager = void 0;
|
|
15
15
|
const MAX_CHARS = 15000;
|
|
16
16
|
const COOLDOWN_SECONDS = 60; // 1 minute cooldown between saves
|
|
17
|
-
// TTL
|
|
18
|
-
const
|
|
19
|
-
localhost: 15 * 60,
|
|
20
|
-
development: 30 * 60,
|
|
21
|
-
production: 36 * 60 * 60 // 36 hours
|
|
22
|
-
};
|
|
17
|
+
// TTL: 36 hours for all environments (seconds)
|
|
18
|
+
const TTL_SECONDS = 36 * 60 * 60;
|
|
23
19
|
class ContextEnhancerManager {
|
|
24
|
-
constructor(redisClient
|
|
20
|
+
constructor(redisClient) {
|
|
25
21
|
this.redisClient = redisClient;
|
|
26
|
-
this.ttlSeconds =
|
|
22
|
+
this.ttlSeconds = TTL_SECONDS;
|
|
27
23
|
}
|
|
28
24
|
key(roomId) {
|
|
29
25
|
return `smarttranslate:context-enhancer:${roomId}`;
|