Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
PeerTube
PeerTube
Commits
7d5c43f7
Verified
Commit
7d5c43f7
authored
Nov 08, 2021
by
Chocobozzz
Browse files
PR remarks
parent
56e00f75
Changes
3
Hide whitespace changes
Inline
Side-by-side
scripts/create-move-video-storage-job.ts
View file @
7d5c43f7
...
...
@@ -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
}
.`
)
...
...
server/lib/video-state.ts
View file @
7d5c43f7
...
...
@@ -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
}
}
...
...
support/doc/tools.md
View file @
7d5c43f7
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment