fix type errors

This commit is contained in:
syuilo 2022-09-24 14:45:44 +09:00
parent aa3ca438a2
commit dabe5bf7e9
4 changed files with 24 additions and 42 deletions

View file

@ -5,7 +5,7 @@ import type { User } from '@/models/entities/User.js';
type NoteLike = {
userId: Note['userId'];
text: Note['text'];
cw: Note['cw'];
cw?: Note['cw'];
};
type UserLike = {

View file

@ -39,25 +39,19 @@ export class DbQueueProcessorsService {
) {
}
public start(dbQueue: Bull.Queue<DbJobData>) {
const jobs = {
deleteDriveFiles: (job, done) => this.deleteDriveFilesProcessorService.process(job, done),
exportCustomEmojis: (job, done) => this.exportCustomEmojisProcessorService.process(job, done),
exportNotes: (job, done) => this.exportNotesProcessorService.process(job, done),
exportFollowing: (job, done) => this.exportFollowingProcessorService.process(job, done),
exportMuting: (job, done) => this.exportMutingProcessorService.process(job, done),
exportBlocking: (job, done) => this.exportBlockingProcessorService.process(job, done),
exportUserLists: (job, done) => this.exportUserListsProcessorService.process(job, done),
importFollowing: (job, done) => this.importFollowingProcessorService.process(job, done),
importMuting: (job, done) => this.importMutingProcessorService.process(job, done),
importBlocking: (job, done) => this.importBlockingProcessorService.process(job, done),
importUserLists: (job, done) => this.importUserListsProcessorService.process(job, done),
importCustomEmojis: (job, done) => this.importCustomEmojisProcessorService.process(job, done),
deleteAccount: (job) => this.deleteAccountProcessorService.process(job),
} as Record<string, Bull.ProcessCallbackFunction<DbJobData | Bull.ProcessPromiseFunction<DbJobData>>>;
for (const [k, v] of Object.entries(jobs)) {
dbQueue.process(k, v);
}
public start(q: Bull.Queue): void {
q.process('deleteDriveFiles', (job, done) => this.deleteDriveFilesProcessorService.process(job, done));
q.process('exportCustomEmojis', (job, done) => this.exportCustomEmojisProcessorService.process(job, done));
q.process('exportNotes', (job, done) => this.exportNotesProcessorService.process(job, done));
q.process('exportFollowing', (job, done) => this.exportFollowingProcessorService.process(job, done));
q.process('exportMuting', (job, done) => this.exportMutingProcessorService.process(job, done));
q.process('exportBlocking', (job, done) => this.exportBlockingProcessorService.process(job, done));
q.process('exportUserLists', (job, done) => this.exportUserListsProcessorService.process(job, done));
q.process('importFollowing', (job, done) => this.importFollowingProcessorService.process(job, done));
q.process('importMuting', (job, done) => this.importMutingProcessorService.process(job, done));
q.process('importBlocking', (job, done) => this.importBlockingProcessorService.process(job, done));
q.process('importUserLists', (job, done) => this.importUserListsProcessorService.process(job, done));
q.process('importCustomEmojis', (job, done) => this.importCustomEmojisProcessorService.process(job, done));
q.process('deleteAccount', (job) => this.deleteAccountProcessorService.process(job));
}
}

View file

@ -17,14 +17,8 @@ export class ObjectStorageQueueProcessorsService {
) {
}
public start(q: Bull.Queue) {
const jobs = {
deleteFile: (job) => this.deleteFileProcessorService.process(job),
cleanRemoteFiles: (job, done) => this.cleanRemoteFilesProcessorService.process(job, done),
} as Record<string, Bull.ProcessCallbackFunction<ObjectStorageJobData | Bull.ProcessPromiseFunction<ObjectStorageJobData>>>;
for (const [k, v] of Object.entries(jobs)) {
q.process(k, 16, v);
}
public start(q: Bull.Queue): void {
q.process('deleteFile', 16, (job) => this.deleteFileProcessorService.process(job));
q.process('cleanRemoteFiles', 16, (job, done) => this.cleanRemoteFilesProcessorService.process(job, done));
}
}

View file

@ -22,17 +22,11 @@ export class SystemQueueProcessorsService {
) {
}
public start(dbQueue: Bull.Queue<Record<string, unknown>>) {
const jobs = {
tickCharts: (job, done) => this.tickChartsProcessorService.process(job, done),
resyncCharts: (job, done) => this.resyncChartsProcessorService.process(job, done),
cleanCharts: (job, done) => this.cleanChartsProcessorService.process(job, done),
checkExpiredMutings: (job, done) => this.checkExpiredMutingsProcessorService.process(job, done),
clean: (job, done) => this.cleanProcessorService.process(job, done),
} as Record<string, Bull.ProcessCallbackFunction<Record<string, unknown>> | Bull.ProcessPromiseFunction<Record<string, unknown>>>;
for (const [k, v] of Object.entries(jobs)) {
dbQueue.process(k, v);
}
public start(q: Bull.Queue): void {
q.process('tickCharts', (job, done) => this.tickChartsProcessorService.process(job, done));
q.process('resyncCharts', (job, done) => this.resyncChartsProcessorService.process(job, done));
q.process('cleanCharts', (job, done) => this.cleanChartsProcessorService.process(job, done));
q.process('checkExpiredMutings', (job, done) => this.checkExpiredMutingsProcessorService.process(job, done));
q.process('clean', (job, done) => this.cleanProcessorService.process(job, done));
}
}