mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
More robust move to object storage job failure
This commit is contained in:
parent
0c9a835466
commit
3256771725
2 changed files with 23 additions and 5 deletions
|
@ -48,15 +48,24 @@ export async function processMoveToObjectStorage (job: Job) {
|
|||
await doAfterLastJob({ video, previousVideoState: payload.previousVideoState, isNewVideo: payload.isNewVideo })
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error('Cannot move video %s to object storage.', video.url, { err, ...lTags })
|
||||
|
||||
await moveToFailedMoveToObjectStorageState(video)
|
||||
await VideoJobInfoModel.abortAllTasks(video.uuid, 'pendingMove')
|
||||
await onMoveToObjectStorageFailure(job, err)
|
||||
}
|
||||
|
||||
return payload.videoUUID
|
||||
}
|
||||
|
||||
export async function onMoveToObjectStorageFailure (job: Job, err: any) {
|
||||
const payload = job.data as MoveObjectStoragePayload
|
||||
|
||||
const video = await VideoModel.loadWithFiles(payload.videoUUID)
|
||||
if (!video) return
|
||||
|
||||
logger.error('Cannot move video %s to object storage.', video.url, { err, ...lTagsBase(video.uuid, video.url) })
|
||||
|
||||
await moveToFailedMoveToObjectStorageState(video)
|
||||
await VideoJobInfoModel.abortAllTasks(video.uuid, 'pendingMove')
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
async function moveWebTorrentFiles (video: MVideoWithAllFiles) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue