fix: no logging for postgres
This commit is contained in:
parent
13ede22564
commit
2a5598fa7f
1 changed files with 12 additions and 12 deletions
|
@ -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) });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue