Apply suggestions

This commit is contained in:
Marie 2024-12-09 05:58:25 +01:00
parent 1d0fd4c40b
commit 152cc07483
No known key found for this signature in database
GPG key ID: 7ADF6C9CD9A28555
3 changed files with 9 additions and 4 deletions

View file

@ -10,6 +10,7 @@ import { NoteCreateService } from '@/core/NoteCreateService.js';
import type { ChannelsRepository, DriveFilesRepository, MiDriveFile, NoteScheduleRepository, NotesRepository, UsersRepository } from '@/models/_.js';
import { DI } from '@/di-symbols.js';
import { NotificationService } from '@/core/NotificationService.js';
import { IdentifiableError } from '@/misc/identifiable-error.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { ScheduleNotePostJobData } from '../types.js';
@ -119,6 +120,12 @@ export class ScheduleNotePostProcessorService {
reply,
renote,
channel,
}).catch(async (err: IdentifiableError) => {
this.notificationService.createNotification(me.id, 'scheduledNoteFailed', {
reason: err.message,
});
await this.noteScheduleRepository.remove(data);
throw this.logger.error(`Schedule Note Failed Reason: ${err.message}`);
});
await this.noteScheduleRepository.remove(data);
this.notificationService.createNotification(me.id, 'scheduledNotePosted', {