aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/job
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-14 17:31:26 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:51 +0100
commit350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad (patch)
treef4191f3c04a5230fcf8ca3d6ca3248643fc4151d /server/models/job
parente34c85e527100c0b5c44567bd951e95be41b8d7e (diff)
downloadPeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.tar.gz
PeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.tar.zst
PeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.zip
Follow works
Diffstat (limited to 'server/models/job')
-rw-r--r--server/models/job/job.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/models/job/job.ts b/server/models/job/job.ts
index ce1203e5a..c2d088090 100644
--- a/server/models/job/job.ts
+++ b/server/models/job/job.ts
@@ -10,7 +10,7 @@ import {
10 10
11 JobMethods 11 JobMethods
12} from './job-interface' 12} from './job-interface'
13import { JobState } from '../../../shared/models/job.model' 13import { JobCategory, JobState } from '../../../shared/models/job.model'
14 14
15let Job: Sequelize.Model<JobInstance, JobAttributes> 15let Job: Sequelize.Model<JobInstance, JobAttributes>
16let listWithLimitByCategory: JobMethods.ListWithLimitByCategory 16let listWithLimitByCategory: JobMethods.ListWithLimitByCategory
@@ -38,7 +38,7 @@ export default function defineJob (sequelize: Sequelize.Sequelize, DataTypes: Se
38 { 38 {
39 indexes: [ 39 indexes: [
40 { 40 {
41 fields: [ 'state' ] 41 fields: [ 'state', 'category' ]
42 } 42 }
43 ] 43 ]
44 } 44 }
@@ -52,14 +52,15 @@ export default function defineJob (sequelize: Sequelize.Sequelize, DataTypes: Se
52 52
53// --------------------------------------------------------------------------- 53// ---------------------------------------------------------------------------
54 54
55listWithLimitByCategory = function (limit: number, state: JobState) { 55listWithLimitByCategory = function (limit: number, state: JobState, jobCategory: JobCategory) {
56 const query = { 56 const query = {
57 order: [ 57 order: [
58 [ 'id', 'ASC' ] 58 [ 'id', 'ASC' ]
59 ], 59 ],
60 limit: limit, 60 limit: limit,
61 where: { 61 where: {
62 state 62 state,
63 category: jobCategory
63 } 64 }
64 } 65 }
65 66