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