aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0230-kue-to-bull.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/migrations/0230-kue-to-bull.ts')
-rw-r--r--server/initializers/migrations/0230-kue-to-bull.ts9
1 files changed, 3 insertions, 6 deletions
diff --git a/server/initializers/migrations/0230-kue-to-bull.ts b/server/initializers/migrations/0230-kue-to-bull.ts
index 5fad87a61..5f4d88bef 100644
--- a/server/initializers/migrations/0230-kue-to-bull.ts
+++ b/server/initializers/migrations/0230-kue-to-bull.ts
@@ -2,6 +2,7 @@ import * as Sequelize from 'sequelize'
2import { createClient } from 'redis' 2import { createClient } from 'redis'
3import { CONFIG } from '../constants' 3import { CONFIG } from '../constants'
4import { JobQueue } from '../../lib/job-queue' 4import { JobQueue } from '../../lib/job-queue'
5import { Redis } from '../../lib/redis'
5import { initDatabaseModels } from '../database' 6import { initDatabaseModels } from '../database'
6 7
7async function up (utils: { 8async function up (utils: {
@@ -12,11 +13,7 @@ async function up (utils: {
12 await initDatabaseModels(false) 13 await initDatabaseModels(false)
13 14
14 return new Promise((res, rej) => { 15 return new Promise((res, rej) => {
15 const client = createClient({ 16 const client = createClient(Redis.getRedisClient())
16 host: CONFIG.REDIS.HOSTNAME,
17 port: CONFIG.REDIS.PORT,
18 db: CONFIG.REDIS.DB
19 })
20 17
21 const jobsPrefix = 'q-' + CONFIG.WEBSERVER.HOST 18 const jobsPrefix = 'q-' + CONFIG.WEBSERVER.HOST
22 19
@@ -36,7 +33,7 @@ async function up (utils: {
36 return res({ type: job.type, payload: parsedData }) 33 return res({ type: job.type, payload: parsedData })
37 } catch (err) { 34 } catch (err) {
38 console.error('Cannot parse data %s.', job.data) 35 console.error('Cannot parse data %s.', job.data)
39 return res(null) 36 return res(undefined)
40 } 37 }
41 }) 38 })
42 }) 39 })