mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-11-22 16:56:39 -06:00
Success on update "not in processing state" error
Or the job is never "ended"
This commit is contained in:
parent
0e718cb7b2
commit
4e98d843da
@ -152,6 +152,9 @@ export class ProcessLiveRTMPHLSTranscoding {
|
|||||||
if (type === ServerErrorCode.RUNNER_JOB_NOT_IN_PROCESSING_STATE) {
|
if (type === ServerErrorCode.RUNNER_JOB_NOT_IN_PROCESSING_STATE) {
|
||||||
logger.info('Stopping transcoding as the job is not in processing state anymore')
|
logger.info('Stopping transcoding as the job is not in processing state anymore')
|
||||||
|
|
||||||
|
this.sendSuccess()
|
||||||
|
.catch(err => logger.error({ err }, 'Cannot send success'))
|
||||||
|
|
||||||
res()
|
res()
|
||||||
} else {
|
} else {
|
||||||
logger.error({ err }, 'Cannot send update after added/deleted chunk, stopping live transcoding')
|
logger.error({ err }, 'Cannot send update after added/deleted chunk, stopping live transcoding')
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||||
import { expect } from 'chai'
|
|
||||||
import { wait } from '@peertube/peertube-core-utils'
|
import { wait } from '@peertube/peertube-core-utils'
|
||||||
import { HttpStatusCode, VideoPrivacy } from '@peertube/peertube-models'
|
import { HttpStatusCode, RunnerJobState, VideoPrivacy } from '@peertube/peertube-models'
|
||||||
import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils'
|
import { areMockObjectStorageTestsDisabled } from '@peertube/peertube-node-utils'
|
||||||
import {
|
import {
|
||||||
|
ObjectStorageCommand,
|
||||||
|
PeerTubeServer,
|
||||||
cleanupTests,
|
cleanupTests,
|
||||||
createMultipleServers,
|
createMultipleServers,
|
||||||
doubleFollow,
|
doubleFollow,
|
||||||
findExternalSavedVideo,
|
findExternalSavedVideo,
|
||||||
makeRawRequest,
|
makeRawRequest,
|
||||||
ObjectStorageCommand,
|
|
||||||
PeerTubeServer,
|
|
||||||
setAccessTokensToServers,
|
setAccessTokensToServers,
|
||||||
setDefaultVideoChannel,
|
setDefaultVideoChannel,
|
||||||
stopFfmpeg,
|
stopFfmpeg,
|
||||||
@ -23,6 +22,7 @@ import { checkPeerTubeRunnerCacheIsEmpty } from '@tests/shared/directories.js'
|
|||||||
import { testLiveVideoResolutions } from '@tests/shared/live.js'
|
import { testLiveVideoResolutions } from '@tests/shared/live.js'
|
||||||
import { PeerTubeRunnerProcess } from '@tests/shared/peertube-runner-process.js'
|
import { PeerTubeRunnerProcess } from '@tests/shared/peertube-runner-process.js'
|
||||||
import { SQLCommand } from '@tests/shared/sql-command.js'
|
import { SQLCommand } from '@tests/shared/sql-command.js'
|
||||||
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('Test Live transcoding in peertube-runner program', function () {
|
describe('Test Live transcoding in peertube-runner program', function () {
|
||||||
let servers: PeerTubeServer[] = []
|
let servers: PeerTubeServer[] = []
|
||||||
@ -54,8 +54,19 @@ describe('Test Live transcoding in peertube-runner program', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
await stopFfmpeg(ffmpegCommand)
|
await stopFfmpeg(ffmpegCommand)
|
||||||
|
|
||||||
await waitUntilLiveWaitingOnAllServers(servers, video.uuid)
|
await waitUntilLiveWaitingOnAllServers(servers, video.uuid)
|
||||||
|
|
||||||
|
const { data } = await servers[0].runnerJobs.list({ sort: '-createdAt' })
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
const liveJob = data.find(d => d.type === 'live-rtmp-hls-transcoding')
|
||||||
|
expect(liveJob).to.exist
|
||||||
|
|
||||||
|
if (liveJob.state.id === RunnerJobState.COMPLETED) break
|
||||||
|
|
||||||
|
await wait(500)
|
||||||
|
}
|
||||||
|
|
||||||
await servers[0].videos.remove({ id: video.id })
|
await servers[0].videos.remove({ id: video.id })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user