Verified Commit 7d5c43f7 authored by Chocobozzz's avatar Chocobozzz
Browse files

PR remarks

parent 56e00f75
......@@ -71,7 +71,14 @@ async function run () {
if (files.some(f => f.storage === VideoStorage.FILE_SYSTEM) || hls?.storage === VideoStorage.FILE_SYSTEM) {
console.log('Processing video %s.', videoFull.name)
await moveToExternalStorageState(videoFull, false, undefined)
const success = await moveToExternalStorageState(videoFull, false, undefined)
if (!success) {
console.error(
'Cannot create move job for %s: job creation may have failed or there may be pending transcoding jobs for this video',
videoFull.name
)
}
}
console.log(`Created move-to-object-storage job for ${videoFull.name}.`)
......
......@@ -62,7 +62,7 @@ async function moveToExternalStorageState (video: MVideoFullLight, isNewVideo: b
const pendingTranscode = videoJobInfo?.pendingTranscode || 0
// We want to wait all transcoding jobs before moving the video on an external storage
if (pendingTranscode !== 0) return
if (pendingTranscode !== 0) return false
await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, isNewVideo, transaction)
......@@ -70,8 +70,12 @@ async function moveToExternalStorageState (video: MVideoFullLight, isNewVideo: b
try {
await addMoveToObjectStorageJob(video, isNewVideo)
return true
} catch (err) {
logger.error('Cannot add move to object storage job', { err })
return false
}
}
......
......@@ -17,6 +17,7 @@
- [regenerate-thumbnails.js](#regenerate-thumbnailsjs)
- [create-transcoding-job.js](#create-transcoding-jobjs)
- [create-import-video-file-job.js](#create-import-video-file-jobjs)
- [create-move-video-storage-job.js](#create-move-video-storage-jobjs)
- [prune-storage.js](#prune-storagejs)
- [update-host.js](#update-hostjs)
- [reset-password.js](#reset-passwordjs)
......@@ -305,7 +306,7 @@ $ docker-compose exec -u peertube peertube npm run create-import-video-file-job
### create-move-video-storage-job.js
Use this script to move a specific video file in object storage.
Use this script to move all video files or a specific video file to object storage.
```bash
$ # Basic installation
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment