mirror of
https://git.boykissers.com/pawkey/pawkey-sk.git
synced 2025-12-20 04:04:16 +00:00
update latest note in background (don't await the result)
This commit is contained in:
@@ -152,7 +152,7 @@ export class NoteDeleteService {
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
await this.updateLatestNote(note);
|
||||
this.updateLatestNoteBG(note);
|
||||
|
||||
if (deleter && (note.userId !== deleter.id)) {
|
||||
const user = await this.usersRepository.findOneByOrFail({ id: note.userId });
|
||||
@@ -236,6 +236,12 @@ export class NoteDeleteService {
|
||||
}
|
||||
}
|
||||
|
||||
private updateLatestNoteBG(note: MiNote): void {
|
||||
this
|
||||
.updateLatestNote(note)
|
||||
.catch(err => console.error('Unhandled exception while updating latest_note (after delete):', err));
|
||||
}
|
||||
|
||||
private async updateLatestNote(note: MiNote) {
|
||||
// If it's a DM, then it can't possibly be the latest note so we can safely skip this.
|
||||
if (note.visibility === 'specified') return;
|
||||
|
||||
Reference in New Issue
Block a user