aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/request
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-05-22 20:58:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-05-25 17:32:16 +0200
commite02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch)
treeb7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/lib/request
parent65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff)
downloadPeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.gz
PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.zst
PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.zip
Type models
Diffstat (limited to 'server/lib/request')
-rw-r--r--server/lib/request/base-request-scheduler.ts4
-rw-r--r--server/lib/request/request-scheduler.ts9
-rw-r--r--server/lib/request/request-video-event-scheduler.ts2
-rw-r--r--server/lib/request/request-video-qadu-scheduler.ts2
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 @@
1import { eachLimit } from 'async/eachLimit' 1import * as eachLimit from 'async/eachLimit'
2 2
3const db = require('../../initializers/database') 3import { database as db } from '../../initializers/database'
4import { logger, makeSecureRequest } from '../../helpers' 4import { logger, makeSecureRequest } from '../../helpers'
5import { 5import {
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 @@
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
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 @@
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 { 3import {
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 @@
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 {