diff --git a/src/main/ai/AiWorker.ts b/src/main/ai/AiWorker.ts index ae4306d..809530a 100644 --- a/src/main/ai/AiWorker.ts +++ b/src/main/ai/AiWorker.ts @@ -176,7 +176,8 @@ export class AiWorker { candidatesCount: candidates.length }); if (this.telemetry) { - await this.telemetry.emit({ + const telemetry = this.telemetry; + await telemetry.emit({ kind: 'ai_succeeded', payload: { noteId: job.noteId, @@ -192,13 +193,13 @@ export class AiWorker { if (vocabSet.has(tagName.toLowerCase())) { const tagId = this.repo.getTagIdByName(tagName); if (tagId !== null) { - await this.telemetry.emit({ + await telemetry.emit({ kind: 'tag_vocab_hit', payload: { tagId, vocabSize: vocab.length } }).catch(() => {}); } } else { - await this.telemetry.emit({ + await telemetry.emit({ kind: 'tag_vocab_miss', payload: { vocabSize: vocab.length } }).catch(() => {});