diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-08 10:08:36 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-12-08 10:08:36 +0100 |
commit | e11f68a3562d2468480c396f47f1bdd2a306e17a (patch) | |
tree | c773ea89b0ea4b871e0265449501477b64233b00 /server/tests/api/single-server.ts | |
parent | cadb46d832724ea1a17b085b992142aa32e212be (diff) | |
download | PeerTube-e11f68a3562d2468480c396f47f1bdd2a306e17a.tar.gz PeerTube-e11f68a3562d2468480c396f47f1bdd2a306e17a.tar.zst PeerTube-e11f68a3562d2468480c396f47f1bdd2a306e17a.zip |
Optimise transaction for video upload
Diffstat (limited to 'server/tests/api/single-server.ts')
-rw-r--r-- | server/tests/api/single-server.ts | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/server/tests/api/single-server.ts b/server/tests/api/single-server.ts index ed79f9e1c..e99955ef4 100644 --- a/server/tests/api/single-server.ts +++ b/server/tests/api/single-server.ts | |||
@@ -364,7 +364,7 @@ describe('Test a single server', function () { | |||
364 | 'video_short1.webm', 'video_short2.webm', 'video_short3.webm' | 364 | 'video_short1.webm', 'video_short2.webm', 'video_short3.webm' |
365 | ] | 365 | ] |
366 | 366 | ||
367 | // const tasks: Promise<any>[] = [] | 367 | const tasks: Promise<any>[] = [] |
368 | for (const video of videos) { | 368 | for (const video of videos) { |
369 | const videoAttributes = { | 369 | const videoAttributes = { |
370 | name: video + ' name', | 370 | name: video + ' name', |
@@ -378,13 +378,10 @@ describe('Test a single server', function () { | |||
378 | } | 378 | } |
379 | 379 | ||
380 | const p = uploadVideo(server.url, server.accessToken, videoAttributes) | 380 | const p = uploadVideo(server.url, server.accessToken, videoAttributes) |
381 | await p | 381 | tasks.push(p) |
382 | } | 382 | } |
383 | // FIXME: concurrent uploads does not work :( | 383 | |
384 | // tasks.push(p) | 384 | await Promise.all(tasks) |
385 | // } | ||
386 | // | ||
387 | // await Promise.all(tasks) | ||
388 | }) | 385 | }) |
389 | 386 | ||
390 | it('Should have the correct durations', async function () { | 387 | it('Should have the correct durations', async function () { |
@@ -712,7 +709,7 @@ describe('Test a single server', function () { | |||
712 | const filePath = join(__dirname, '..', 'api', 'fixtures', 'video_short.webm') | 709 | const filePath = join(__dirname, '..', 'api', 'fixtures', 'video_short.webm') |
713 | 710 | ||
714 | await req.attach('videofile', filePath) | 711 | await req.attach('videofile', filePath) |
715 | .expect(204) | 712 | .expect(200) |
716 | 713 | ||
717 | const res = await getVideosList(server.url) | 714 | const res = await getVideosList(server.url) |
718 | const video = res.body.data.find(v => v.name === 'minimum parameters') | 715 | const video = res.body.data.find(v => v.name === 'minimum parameters') |