diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-22 20:58:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-25 17:32:16 +0200 |
commit | e02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch) | |
tree | b7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/lib/jobs | |
parent | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff) | |
download | PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.gz PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.zst PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.zip |
Type models
Diffstat (limited to 'server/lib/jobs')
-rw-r--r-- | server/lib/jobs/handlers/video-transcoder.ts | 2 | ||||
-rw-r--r-- | server/lib/jobs/job-scheduler.ts | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/jobs/handlers/video-transcoder.ts b/server/lib/jobs/handlers/video-transcoder.ts index 35db5fb96..43599356a 100644 --- a/server/lib/jobs/handlers/video-transcoder.ts +++ b/server/lib/jobs/handlers/video-transcoder.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | const db = require('../../../initializers/database') | 1 | import { database as db } from '../../../initializers/database' |
2 | import { logger } from '../../../helpers' | 2 | import { logger } from '../../../helpers' |
3 | import { addVideoToFriends } from '../../../lib' | 3 | import { addVideoToFriends } from '../../../lib' |
4 | 4 | ||
diff --git a/server/lib/jobs/job-scheduler.ts b/server/lib/jobs/job-scheduler.ts index 7b8c6faf9..ad5f7f6d9 100644 --- a/server/lib/jobs/job-scheduler.ts +++ b/server/lib/jobs/job-scheduler.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { forever, queue } from 'async' | 1 | import { forever, queue } from 'async' |
2 | 2 | ||
3 | const db = require('../../initializers/database') | 3 | import { database as db } from '../../initializers/database' |
4 | import { | 4 | import { |
5 | JOBS_FETCHING_INTERVAL, | 5 | JOBS_FETCHING_INTERVAL, |
6 | JOBS_FETCH_LIMIT_PER_CYCLE, | 6 | JOBS_FETCH_LIMIT_PER_CYCLE, |
@@ -24,7 +24,7 @@ class JobScheduler { | |||
24 | 24 | ||
25 | logger.info('Jobs scheduler activated.') | 25 | logger.info('Jobs scheduler activated.') |
26 | 26 | ||
27 | const jobsQueue = queue(this.processJob) | 27 | const jobsQueue = queue(this.processJob.bind(this)) |
28 | 28 | ||
29 | // Finish processing jobs from a previous start | 29 | // Finish processing jobs from a previous start |
30 | const state = JOB_STATES.PROCESSING | 30 | const state = JOB_STATES.PROCESSING |
@@ -58,7 +58,7 @@ class JobScheduler { | |||
58 | }) | 58 | }) |
59 | } | 59 | } |
60 | 60 | ||
61 | createJob (transaction, handlerName, handlerInputData, callback) { | 61 | createJob (transaction, handlerName: string, handlerInputData: object, callback) { |
62 | const createQuery = { | 62 | const createQuery = { |
63 | state: JOB_STATES.PENDING, | 63 | state: JOB_STATES.PENDING, |
64 | handlerName, | 64 | handlerName, |