diff --git a/apps/workers/utils.ts b/apps/workers/utils.ts index 8e69dcd2..2372684e 100644 --- a/apps/workers/utils.ts +++ b/apps/workers/utils.ts @@ -40,7 +40,7 @@ export async function readPDFText(buffer: Buffer): Promise<{ export function truncateContent(content: string, length = 1500) { let words = content.split(" "); if (words.length > length) { - words = words.slice(length); + words = words.slice(0, length); content = words.join(" "); } return content;