diff options
Diffstat (limited to 'server/lib/request')
-rw-r--r-- | server/lib/request/base-request-scheduler.ts | 4 | ||||
-rw-r--r-- | server/lib/request/request-scheduler.ts | 9 | ||||
-rw-r--r-- | server/lib/request/request-video-event-scheduler.ts | 2 | ||||
-rw-r--r-- | server/lib/request/request-video-qadu-scheduler.ts | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/server/lib/request/base-request-scheduler.ts b/server/lib/request/base-request-scheduler.ts index 7fc88b5f1..b7ef6abf9 100644 --- a/server/lib/request/base-request-scheduler.ts +++ b/server/lib/request/base-request-scheduler.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { eachLimit } from 'async/eachLimit' | 1 | import * as eachLimit from 'async/eachLimit' |
2 | 2 | ||
3 | const db = require('../../initializers/database') | 3 | import { database as db } from '../../initializers/database' |
4 | import { logger, makeSecureRequest } from '../../helpers' | 4 | import { logger, makeSecureRequest } from '../../helpers' |
5 | import { | 5 | import { |
6 | API_VERSION, | 6 | API_VERSION, |
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 @@ | |||
1 | const db = require('../../initializers/database') | 1 | import { database as db } from '../../initializers/database' |
2 | import { BaseRequestScheduler } from './base-request-scheduler' | 2 | import { BaseRequestScheduler } from './base-request-scheduler' |
3 | import { logger } from '../../helpers' | 3 | import { logger } from '../../helpers' |
4 | import { | 4 | import { |
@@ -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 | ||
diff --git a/server/lib/request/request-video-event-scheduler.ts b/server/lib/request/request-video-event-scheduler.ts index 6e5306c7d..bde50b1d3 100644 --- a/server/lib/request/request-video-event-scheduler.ts +++ b/server/lib/request/request-video-event-scheduler.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | const db = require('../../initializers/database') | 1 | import { database as db } from '../../initializers/database' |
2 | import { BaseRequestScheduler } from './base-request-scheduler' | 2 | import { BaseRequestScheduler } from './base-request-scheduler' |
3 | import { | 3 | import { |
4 | REQUESTS_VIDEO_EVENT_LIMIT_PODS, | 4 | REQUESTS_VIDEO_EVENT_LIMIT_PODS, |
diff --git a/server/lib/request/request-video-qadu-scheduler.ts b/server/lib/request/request-video-qadu-scheduler.ts index d81822723..dab526088 100644 --- a/server/lib/request/request-video-qadu-scheduler.ts +++ b/server/lib/request/request-video-qadu-scheduler.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | const db = require('../../initializers/database') | 1 | import { database as db } from '../../initializers/database' |
2 | import { BaseRequestScheduler } from './base-request-scheduler' | 2 | import { BaseRequestScheduler } from './base-request-scheduler' |
3 | import { logger } from '../../helpers' | 3 | import { logger } from '../../helpers' |
4 | import { | 4 | import { |