diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-29 16:26:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-30 15:03:18 +0200 |
commit | 6b6168606bc86430f6b7821c9d5f1c80d0425ebf (patch) | |
tree | 9aea6cf0875c9fee30c373eb4924b12d47d1e23c /server/tests/utils | |
parent | 2d9fea161fd4fc73994fc77951bafdccdc2071fd (diff) | |
download | PeerTube-6b6168606bc86430f6b7821c9d5f1c80d0425ebf.tar.gz PeerTube-6b6168606bc86430f6b7821c9d5f1c80d0425ebf.tar.zst PeerTube-6b6168606bc86430f6b7821c9d5f1c80d0425ebf.zip |
Bufferize videos views in redis
Diffstat (limited to 'server/tests/utils')
-rw-r--r-- | server/tests/utils/server/jobs.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/tests/utils/server/jobs.ts b/server/tests/utils/server/jobs.ts index c9cb8d3a3..4c02cace5 100644 --- a/server/tests/utils/server/jobs.ts +++ b/server/tests/utils/server/jobs.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as request from 'supertest' | 1 | import * as request from 'supertest' |
2 | import { JobState } from '../../../../shared/models' | 2 | import { Job, JobState } from '../../../../shared/models' |
3 | import { ServerInfo, wait } from '../index' | 3 | import { ServerInfo, wait } from '../index' |
4 | 4 | ||
5 | function getJobsList (url: string, accessToken: string, state: JobState) { | 5 | function getJobsList (url: string, accessToken: string, state: JobState) { |
@@ -44,8 +44,10 @@ async function waitJobs (serversArg: ServerInfo[] | ServerInfo) { | |||
44 | for (const server of servers) { | 44 | for (const server of servers) { |
45 | for (const state of states) { | 45 | for (const state of states) { |
46 | const p = getJobsListPaginationAndSort(server.url, server.accessToken, state, 0, 10, '-createdAt') | 46 | const p = getJobsListPaginationAndSort(server.url, server.accessToken, state, 0, 10, '-createdAt') |
47 | .then(res => { | 47 | .then(res => res.body.data) |
48 | if (res.body.total > 0) pendingRequests = true | 48 | .then((jobs: Job[]) => jobs.filter(j => j.type !== 'videos-views')) |
49 | .then(jobs => { | ||
50 | if (jobs.length !== 0) pendingRequests = true | ||
49 | }) | 51 | }) |
50 | tasks.push(p) | 52 | tasks.push(p) |
51 | } | 53 | } |