Add queue types (#7504)
This commit is contained in:
parent
164959a0c5
commit
591a5c277c
18 changed files with 97 additions and 50 deletions
|
@ -8,10 +8,11 @@ import dateFormat = require('dateformat');
|
|||
import { getFullApAccount } from '@/misc/convert-host';
|
||||
import { Users, Blockings } from '../../../models';
|
||||
import { MoreThan } from 'typeorm';
|
||||
import { DbUserJobData } from '@/queue/types';
|
||||
|
||||
const logger = queueLogger.createSubLogger('export-blocking');
|
||||
|
||||
export async function exportBlocking(job: Bull.Job, done: any): Promise<void> {
|
||||
export async function exportBlocking(job: Bull.Job<DbUserJobData>, done: any): Promise<void> {
|
||||
logger.info(`Exporting blocking of ${job.data.user.id} ...`);
|
||||
|
||||
const user = await Users.findOne(job.data.user.id);
|
||||
|
@ -61,7 +62,7 @@ export async function exportBlocking(job: Bull.Job, done: any): Promise<void> {
|
|||
}
|
||||
|
||||
const content = getFullApAccount(u.username, u.host);
|
||||
await new Promise((res, rej) => {
|
||||
await new Promise<void>((res, rej) => {
|
||||
stream.write(content + '\n', err => {
|
||||
if (err) {
|
||||
logger.error(err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue