MCPcopy Create free account
hub / github.com/Rfym21/Qwen2API / updateActivity

Function updateActivity

src/utils/redis.js:170–182  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

168 */
169const updateActivity = () => {
170 lastActivity = Date.now()
171
172 clearIdleTimer()
173
174 // 设置新的空闲定时器
175 idleTimer = setTimeout(() => {
176 if (redis && Date.now() - lastActivity > IDLE_TIMEOUT) {
177 logger.info('Redis连接空闲超时,断开连接', 'REDIS', '🔌')
178 disconnectRedis()
179 }
180 }, IDLE_TIMEOUT)
181}
182
183/**
184 * 绑定 Redis 事件
185 * @param {object} client - Redis 客户端实例

Callers 3

bindRedisEventsFunction · 0.85
connectRedisFunction · 0.85
ensureConnectionFunction · 0.85

Calls 3

clearIdleTimerFunction · 0.85
disconnectRedisFunction · 0.85
infoMethod · 0.80

Tested by

no test coverage detected