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;
|
const meId = me ? me.id : null;
|
||||||
let note: Note | null = null;
|
let note: Note | null = null;
|
||||||
let foundScyllaNote = false;
|
|
||||||
const isSrcNote = typeof src === "object";
|
const isSrcNote = typeof src === "object";
|
||||||
|
|
||||||
// Always lookup from ScyllaDB if enabled
|
// Always lookup from ScyllaDB if enabled
|
||||||
|
@ -212,11 +211,8 @@ export const NoteRepository = db.getRepository(Note).extend({
|
||||||
);
|
);
|
||||||
if (result.rowLength > 0) {
|
if (result.rowLength > 0) {
|
||||||
note = parseScyllaNote(result.first());
|
note = parseScyllaNote(result.first());
|
||||||
foundScyllaNote = true;
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
if (!foundScyllaNote) {
|
|
||||||
// Fallback to Postgres
|
|
||||||
note = await this.findOneBy({ id: noteId });
|
note = await this.findOneBy({ id: noteId });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,7 @@ export async function getNote(
|
||||||
note = filtered[0];
|
note = filtered[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// Fallback to Postgres
|
|
||||||
if (!note) {
|
|
||||||
const query = Notes.createQueryBuilder("note").where("note.id = :id", {
|
const query = Notes.createQueryBuilder("note").where("note.id = :id", {
|
||||||
id: noteId,
|
id: noteId,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue