chore: snapshot before performance optimization
This commit is contained in:
@@ -55,9 +55,10 @@ export async function GET() {
|
||||
continue
|
||||
}
|
||||
|
||||
// Parse and validate embedding
|
||||
// Validate embedding
|
||||
try {
|
||||
const embedding = JSON.parse(note.embedding)
|
||||
if (!note.embedding) continue
|
||||
const embedding = JSON.parse(note.embedding) as number[]
|
||||
const validation = validateEmbedding(embedding)
|
||||
|
||||
if (!validation.valid) {
|
||||
|
||||
@@ -15,9 +15,8 @@ export async function GET() {
|
||||
notes.forEach((note: any) => {
|
||||
if (note.labels) {
|
||||
try {
|
||||
const parsed = JSON.parse(note.labels);
|
||||
if (Array.isArray(parsed)) {
|
||||
parsed.forEach((l: string) => uniqueLabels.add(l));
|
||||
if (Array.isArray(note.labels)) {
|
||||
(note.labels as string[]).forEach((l: string) => uniqueLabels.add(l));
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore error
|
||||
|
||||
Reference in New Issue
Block a user