aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/request/request-scheduler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/request/request-scheduler.ts')
-rw-r--r--server/lib/request/request-scheduler.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/lib/request/request-scheduler.ts b/server/lib/request/request-scheduler.ts
index 2006a6f03..26ffbfb86 100644
--- a/server/lib/request/request-scheduler.ts
+++ b/server/lib/request/request-scheduler.ts
@@ -1,4 +1,4 @@
1const db = require('../../initializers/database') 1import { database as db } from '../../initializers/database'
2import { BaseRequestScheduler } from './base-request-scheduler' 2import { BaseRequestScheduler } from './base-request-scheduler'
3import { logger } from '../../helpers' 3import { logger } from '../../helpers'
4import { 4import {
@@ -59,13 +59,14 @@ class RequestScheduler extends BaseRequestScheduler {
59 const toIds = options.toIds 59 const toIds = options.toIds
60 const transaction = options.transaction 60 const transaction = options.transaction
61 61
62 const pods = [] 62 // TODO: check the setPods works
63 const podIds = []
63 64
64 // If there are no destination pods abort 65 // If there are no destination pods abort
65 if (toIds.length === 0) return callback(null) 66 if (toIds.length === 0) return callback(null)
66 67
67 toIds.forEach(toPod => { 68 toIds.forEach(toPod => {
68 pods.push(db.Pod.build({ id: toPod })) 69 podIds.push(toPod)
69 }) 70 })
70 71
71 const createQuery = { 72 const createQuery = {
@@ -83,7 +84,7 @@ class RequestScheduler extends BaseRequestScheduler {
83 return db.Request.create(createQuery, dbRequestOptions).asCallback((err, request) => { 84 return db.Request.create(createQuery, dbRequestOptions).asCallback((err, request) => {
84 if (err) return callback(err) 85 if (err) return callback(err)
85 86
86 return request.setPods(pods, dbRequestOptions).asCallback(callback) 87 return request.setPods(podIds, dbRequestOptions).asCallback(callback)
87 }) 88 })
88 } 89 }
89 90