Commit 7c31177e authored by nanahira's avatar nanahira

better logs

parent 47498cc3
...@@ -95,7 +95,10 @@ export class ChatgptService ...@@ -95,7 +95,10 @@ export class ChatgptService
); );
} }
async chatProcess(question: TalkDto, failedAccounts: string[] = []) { async chatProcess(
question: TalkDto,
failedAccounts: string[] = [],
): Promise<ConversationDto> {
const session = question.session || uuid(); const session = question.session || uuid();
const previousConversation = failedAccounts.length const previousConversation = failedAccounts.length
? undefined ? undefined
...@@ -112,6 +115,9 @@ export class ChatgptService ...@@ -112,6 +115,9 @@ export class ChatgptService
const result = await account.lock.acquire(async () => { const result = await account.lock.acquire(async () => {
account.occupyTimestamp = Date.now(); account.occupyTimestamp = Date.now();
try { try {
this.log(
`Processing conversation with account ${account.email} for ${session}`,
);
return await account.account.sendMessage(question.text, { return await account.account.sendMessage(question.text, {
...(previousConversation ...(previousConversation
? { ? {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment