This commit is contained in:
syuilo
2018-04-05 18:43:06 +09:00
parent 06347cd71e
commit 7403f38fb4
9 changed files with 50 additions and 27 deletions

View File

@ -1,8 +1,12 @@
import { createQueue } from 'kue';
import * as debug from 'debug';
import config from '../config';
import db from './processors/db';
import http from './processors/http';
const log = debug('misskey:queue');
const queue = createQueue({
redis: {
port: config.redis.port,
@ -12,6 +16,8 @@ const queue = createQueue({
});
export function createHttp(data) {
log(`HTTP job created: ${JSON.stringify(data)}`);
return queue
.create('http', data)
.attempts(16)
@ -22,7 +28,7 @@ export function createDb(data) {
return queue.create('db', data);
}
export function process() {
export default function() {
queue.process('db', db);
/*