diff options
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, |