aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/jobs/job-scheduler.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-05-05 12:15:16 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-05-05 12:15:16 +0200
commit62326afb151a1062253ac8b08bb62ce3f01e1267 (patch)
tree0ab9950e84bdcc935e3c3531d061762eea2c0075 /server/lib/jobs/job-scheduler.js
parentfce897f326af14406ced2f71a00ae89ff297a550 (diff)
downloadPeerTube-62326afb151a1062253ac8b08bb62ce3f01e1267.tar.gz
PeerTube-62326afb151a1062253ac8b08bb62ce3f01e1267.tar.zst
PeerTube-62326afb151a1062253ac8b08bb62ce3f01e1267.zip
Server: Fix video propagation with transcoding enabled
Diffstat (limited to 'server/lib/jobs/job-scheduler.js')
-rw-r--r--server/lib/jobs/job-scheduler.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/lib/jobs/job-scheduler.js b/server/lib/jobs/job-scheduler.js
index 589a30630..c59bf9262 100644
--- a/server/lib/jobs/job-scheduler.js
+++ b/server/lib/jobs/job-scheduler.js
@@ -76,31 +76,31 @@ function processJob (job, callback) {
76 return jobHandler.process(job.handlerInputData, function (err, result) { 76 return jobHandler.process(job.handlerInputData, function (err, result) {
77 if (err) { 77 if (err) {
78 logger.error('Error in job handler %s.', job.handlerName, { error: err }) 78 logger.error('Error in job handler %s.', job.handlerName, { error: err })
79 return onJobError(jobHandler, job, callback) 79 return onJobError(jobHandler, job, result, callback)
80 } 80 }
81 81
82 return onJobSuccess(jobHandler, job, callback) 82 return onJobSuccess(jobHandler, job, result, callback)
83 }) 83 })
84 }) 84 })
85} 85}
86 86
87function onJobError (jobHandler, job, callback) { 87function onJobError (jobHandler, job, jobResult, callback) {
88 job.state = constants.JOB_STATES.ERROR 88 job.state = constants.JOB_STATES.ERROR
89 89
90 job.save().asCallback(function (err) { 90 job.save().asCallback(function (err) {
91 if (err) return cannotSaveJobError(err, callback) 91 if (err) return cannotSaveJobError(err, callback)
92 92
93 return jobHandler.onError(err, job.id, callback) 93 return jobHandler.onError(err, job.id, jobResult, callback)
94 }) 94 })
95} 95}
96 96
97function onJobSuccess (jobHandler, job, callback) { 97function onJobSuccess (jobHandler, job, jobResult, callback) {
98 job.state = constants.JOB_STATES.SUCCESS 98 job.state = constants.JOB_STATES.SUCCESS
99 99
100 job.save().asCallback(function (err) { 100 job.save().asCallback(function (err) {
101 if (err) return cannotSaveJobError(err, callback) 101 if (err) return cannotSaveJobError(err, callback)
102 102
103 return jobHandler.onSuccess(err, job.id, callback) 103 return jobHandler.onSuccess(err, job.id, jobResult, callback)
104 }) 104 })
105} 105}
106 106