1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Optimise transaction for video upload

This commit is contained in:
Chocobozzz 2017-12-08 10:08:36 +01:00
parent cadb46d832
commit e11f68a356
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 53 additions and 57 deletions

View file

@ -364,7 +364,7 @@ describe('Test a single server', function () {
'video_short1.webm', 'video_short2.webm', 'video_short3.webm'
]
// const tasks: Promise<any>[] = []
const tasks: Promise<any>[] = []
for (const video of videos) {
const videoAttributes = {
name: video + ' name',
@ -378,13 +378,10 @@ describe('Test a single server', function () {
}
const p = uploadVideo(server.url, server.accessToken, videoAttributes)
await p
tasks.push(p)
}
// FIXME: concurrent uploads does not work :(
// tasks.push(p)
// }
//
// await Promise.all(tasks)
await Promise.all(tasks)
})
it('Should have the correct durations', async function () {
@ -712,7 +709,7 @@ describe('Test a single server', function () {
const filePath = join(__dirname, '..', 'api', 'fixtures', 'video_short.webm')
await req.attach('videofile', filePath)
.expect(204)
.expect(200)
const res = await getVideosList(server.url)
const video = res.body.data.find(v => v.name === 'minimum parameters')