2
0

📈 Add telemetry webhook

Closes #357
This commit is contained in:
Baptiste Arnaud
2023-03-14 14:18:05 +01:00
parent e7132116f4
commit 9ca17e4e0b
22 changed files with 523 additions and 34 deletions

View File

@ -164,11 +164,10 @@ const saveAnswer =
content: reply,
})
if (reply.includes('http') && block.type === InputBlockType.FILE) {
answer.storageUsed = await computeStorageUsed(reply)
}
if (resultId)
if (resultId) {
if (reply.includes('http') && block.type === InputBlockType.FILE) {
answer.storageUsed = await computeStorageUsed(reply)
}
await prisma.answer.upsert({
where: {
resultId_blockId_groupId: {
@ -180,6 +179,8 @@ const saveAnswer =
create: answer as Prisma.AnswerUncheckedCreateInput,
update: answer,
})
}
return newSessionState
}