いちおう動くようにはなった

Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
This commit is contained in:
mattyatea
2023-11-06 18:15:29 +09:00
parent f72228f428
commit e133a6b6a4
21 changed files with 597 additions and 8 deletions

View File

@@ -0,0 +1,30 @@
/*
* SPDX-FileCopyrightText: syuilo and other misskey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { Inject, Injectable } from '@nestjs/common';
import type Logger from '@/logger.js';
import { bindThis } from '@/decorators.js';
import { NoteCreateService } from '@/core/NoteCreateService.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { ScheduleNotePostJobData } from '../types.js';
@Injectable()
export class ScheduleNotePostProcessorService {
private logger: Logger;
constructor(
private noteCreateService: NoteCreateService,
private queueLoggerService: QueueLoggerService,
) {
this.logger = this.queueLoggerService.logger.createSubLogger('ended-poll-notification');
}
@bindThis
public async process(job: Bull.Job<ScheduleNotePostJobData>): Promise<void> {
job.data.note.createdAt = new Date();
await this.noteCreateService.create(job.data.user, job.data.note);
}
}