fix: no logging for postgres

This commit is contained in:
Namekuji 2023-09-28 20:17:45 -04:00
parent 13ede22564
commit 2a5598fa7f
No known key found for this signature in database
GPG key ID: 1D62332C07FBA532

View file

@ -428,17 +428,14 @@ export const UserRepository = db.getRepository(User).extend({
}).then((notes) => notes.map(({ noteId }) => noteId));
if (pinnedNoteIds.length > 0) {
try {
if (scyllaClient) {
try {
const result = await scyllaClient.execute(
prepared.note.select.byIds,
[pinnedNoteIds],
{ prepare: true },
);
pinnedNotes = result.rows.map(parseScyllaNote);
} else {
pinnedNotes = await Notes.findBy({ id: In(pinnedNoteIds) });
}
} catch (e) {
scyllaLogger.error("Failed to fetch pinned notes", {
pinnedNoteIds,
@ -448,6 +445,9 @@ export const UserRepository = db.getRepository(User).extend({
pinnedNotes = [];
pinnedNoteIds = [];
}
} else {
pinnedNotes = await Notes.findBy({ id: In(pinnedNoteIds) });
}
}
}