aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/remote/videos.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-01-11 16:22:50 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-01-11 16:22:50 +0100
commitdea32aacde362a5fbd62a88cd32487768b788468 (patch)
tree3e11525470bb5a2ba0bfba99087f107494f49edf /server/controllers/api/remote/videos.js
parentbf4ff8fe0be63422c05d42e12f25b454bb95d1a5 (diff)
downloadPeerTube-dea32aacde362a5fbd62a88cd32487768b788468.tar.gz
PeerTube-dea32aacde362a5fbd62a88cd32487768b788468.tar.zst
PeerTube-dea32aacde362a5fbd62a88cd32487768b788468.zip
Server: always check commit result
Diffstat (limited to 'server/controllers/api/remote/videos.js')
-rw-r--r--server/controllers/api/remote/videos.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/server/controllers/api/remote/videos.js b/server/controllers/api/remote/videos.js
index 6d768eae8..17bdce019 100644
--- a/server/controllers/api/remote/videos.js
+++ b/server/controllers/api/remote/videos.js
@@ -171,9 +171,12 @@ function addRemoteVideo (videoToCreateData, fromPod, finalCallback) {
171 } 171 }
172 172
173 // Commit transaction 173 // Commit transaction
174 t.commit() 174 t.commit().asCallback(function (err) {
175 if (err) return finalCallback(err)
175 176
176 return finalCallback() 177 logger.info('Remote video %s inserted.', videoToCreateData.videoToCreateData.name)
178 return finalCallback(null)
179 })
177 }) 180 })
178} 181}
179 182
@@ -254,10 +257,13 @@ function updateRemoteVideo (videoAttributesToUpdate, fromPod, finalCallback) {
254 return finalCallback(err) 257 return finalCallback(err)
255 } 258 }
256 259
257 // Commit transaction 260 // Commit transaction
258 t.commit() 261 t.commit().asCallback(function (err) {
262 if (err) return finalCallback(err)
259 263
260 return finalCallback() 264 logger.info('Remote video %s updated', videoAttributesToUpdate.name)
265 return finalCallback(null)
266 })
261 }) 267 })
262} 268}
263 269