perf: remove fallback to postgres
This commit is contained in:
parent
742c41558a
commit
091f740a29
2 changed files with 2 additions and 9 deletions
|
@ -196,7 +196,6 @@ export const NoteRepository = db.getRepository(Note).extend({
|
|||
|
||||
const meId = me ? me.id : null;
|
||||
let note: Note | null = null;
|
||||
let foundScyllaNote = false;
|
||||
const isSrcNote = typeof src === "object";
|
||||
|
||||
// Always lookup from ScyllaDB if enabled
|
||||
|
@ -212,11 +211,8 @@ export const NoteRepository = db.getRepository(Note).extend({
|
|||
);
|
||||
if (result.rowLength > 0) {
|
||||
note = parseScyllaNote(result.first());
|
||||
foundScyllaNote = true;
|
||||
}
|
||||
}
|
||||
if (!foundScyllaNote) {
|
||||
// Fallback to Postgres
|
||||
} else {
|
||||
note = await this.findOneBy({ id: noteId });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,10 +33,7 @@ export async function getNote(
|
|||
note = filtered[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to Postgres
|
||||
if (!note) {
|
||||
} else {
|
||||
const query = Notes.createQueryBuilder("note").where("note.id = :id", {
|
||||
id: noteId,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue