mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
refactor: Remove redundant debug logging in GenerationJobManager and RedisEventTransport
- Eliminated unnecessary debug statements in GenerationJobManager related to subscriber actions and job updates, enhancing log clarity. - Removed debug logging in RedisEventTransport for subscription and subscriber disconnection events, streamlining the logging output. - Cleaned up debug messages in RedisJobStore to focus on essential information, improving overall logging efficiency.
This commit is contained in:
parent
78848c4af9
commit
ca21f16848
3 changed files with 2 additions and 16 deletions
|
|
@ -221,7 +221,6 @@ class GenerationJobManagerClass {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.debug(`[GenerationJobManager] All subscribers left ${streamId}, reset syncSent`);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.debug(`[GenerationJobManager] Created job: ${streamId}`);
|
logger.debug(`[GenerationJobManager] Created job: ${streamId}`);
|
||||||
|
|
@ -615,7 +614,6 @@ class GenerationJobManagerClass {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.jobStore.updateJob(streamId, updates);
|
this.jobStore.updateJob(streamId, updates);
|
||||||
logger.debug(`[GenerationJobManager] Tracked user message for ${streamId}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -648,7 +646,6 @@ class GenerationJobManagerClass {
|
||||||
updates.promptTokens = metadata.promptTokens;
|
updates.promptTokens = metadata.promptTokens;
|
||||||
}
|
}
|
||||||
this.jobStore.updateJob(streamId, updates);
|
this.jobStore.updateJob(streamId, updates);
|
||||||
logger.debug(`[GenerationJobManager] Updated metadata for ${streamId}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -660,7 +657,6 @@ class GenerationJobManagerClass {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.jobStore.setContentParts(streamId, contentParts);
|
this.jobStore.setContentParts(streamId, contentParts);
|
||||||
logger.debug(`[GenerationJobManager] Set contentParts for ${streamId}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -672,7 +668,6 @@ class GenerationJobManagerClass {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.jobStore.setGraph(streamId, graph);
|
this.jobStore.setGraph(streamId, graph);
|
||||||
logger.debug(`[GenerationJobManager] Set graph reference for ${streamId}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -689,8 +684,8 @@ class GenerationJobManagerClass {
|
||||||
|
|
||||||
logger.debug(`[GenerationJobManager] getResumeState:`, {
|
logger.debug(`[GenerationJobManager] getResumeState:`, {
|
||||||
streamId,
|
streamId,
|
||||||
aggregatedContentLength: aggregatedContent.length,
|
|
||||||
runStepsLength: runSteps.length,
|
runStepsLength: runSteps.length,
|
||||||
|
aggregatedContentLength: aggregatedContent.length,
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,6 @@ export class RedisEventTransport implements IEventTransport {
|
||||||
this.subscriber.subscribe(channel).catch((err) => {
|
this.subscriber.subscribe(channel).catch((err) => {
|
||||||
logger.error(`[RedisEventTransport] Failed to subscribe to ${channel}:`, err);
|
logger.error(`[RedisEventTransport] Failed to subscribe to ${channel}:`, err);
|
||||||
});
|
});
|
||||||
logger.debug(`[RedisEventTransport] Subscribed to channel: ${channel}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return unsubscribe function
|
// Return unsubscribe function
|
||||||
|
|
@ -192,7 +191,6 @@ export class RedisEventTransport implements IEventTransport {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.streams.delete(streamId);
|
this.streams.delete(streamId);
|
||||||
logger.debug(`[RedisEventTransport] All subscribers left ${streamId}`);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -267,8 +267,6 @@ export class RedisJobStore implements IJobStore {
|
||||||
*/
|
*/
|
||||||
async getContentParts(streamId: string): Promise<Agents.MessageContentComplex[] | null> {
|
async getContentParts(streamId: string): Promise<Agents.MessageContentComplex[] | null> {
|
||||||
const chunks = await this.getChunks(streamId);
|
const chunks = await this.getChunks(streamId);
|
||||||
logger.debug(`[RedisJobStore] getContentParts: ${streamId} has ${chunks.length} chunks`);
|
|
||||||
|
|
||||||
if (chunks.length === 0) {
|
if (chunks.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -314,13 +312,10 @@ export class RedisJobStore implements IJobStore {
|
||||||
const key = KEYS.runSteps(streamId);
|
const key = KEYS.runSteps(streamId);
|
||||||
const data = await this.redis.get(key);
|
const data = await this.redis.get(key);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
logger.debug(`[RedisJobStore] getRunSteps: ${streamId} has no run steps`);
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const runSteps = JSON.parse(data);
|
return JSON.parse(data);
|
||||||
logger.debug(`[RedisJobStore] getRunSteps: ${streamId} has ${runSteps.length} run steps`);
|
|
||||||
return runSteps;
|
|
||||||
} catch {
|
} catch {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
@ -352,8 +347,6 @@ export class RedisJobStore implements IJobStore {
|
||||||
*/
|
*/
|
||||||
async appendChunk(streamId: string, event: unknown): Promise<void> {
|
async appendChunk(streamId: string, event: unknown): Promise<void> {
|
||||||
const key = KEYS.chunks(streamId);
|
const key = KEYS.chunks(streamId);
|
||||||
const eventObj = event as { event?: string };
|
|
||||||
logger.debug(`[RedisJobStore] appendChunk: ${streamId} event=${eventObj.event}`);
|
|
||||||
await this.redis.xadd(key, '*', 'event', JSON.stringify(event));
|
await this.redis.xadd(key, '*', 'event', JSON.stringify(event));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue