mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-29 20:34:28 +00:00
feat(transcode): support idle-timeout auto-drain for KEDA scaled jobs
This commit is contained in:
@@ -384,13 +384,7 @@ describe('DbosExecutor Tests', () => {
|
||||
}, 15000)
|
||||
})
|
||||
|
||||
describe('Once mode, events, and conflict handling', () => {
|
||||
it('should force concurrency to 1 in onceMode', () => {
|
||||
executor.setOnceMode(true)
|
||||
expect(executor.isOnceMode()).toBe(true)
|
||||
expect(executor.getTranscodeConcurrencyLimit()).toBe(1)
|
||||
})
|
||||
|
||||
describe('Workflow events and conflict handling', () => {
|
||||
it('should emit workflowStarted and workflowFinished events during execution', async () => {
|
||||
let startedTask: WorkflowTask | null = null
|
||||
let finishedPayload: { taskId: string; success: boolean } | null = null
|
||||
|
||||
@@ -89,7 +89,6 @@ export class DbosExecutor extends EventEmitter {
|
||||
private inFlightSubmits = new Set<Promise<string>>()
|
||||
private executorId?: string
|
||||
private instanceSuffix = Math.random().toString(36).slice(2, 8)
|
||||
private onceMode = false
|
||||
|
||||
constructor(listenQueues?: string[], executorId?: string) {
|
||||
super()
|
||||
@@ -101,14 +100,6 @@ export class DbosExecutor extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
setOnceMode(once: boolean): void {
|
||||
this.onceMode = once
|
||||
}
|
||||
|
||||
isOnceMode(): boolean {
|
||||
return this.onceMode
|
||||
}
|
||||
|
||||
isStarted(): boolean {
|
||||
return this.started
|
||||
}
|
||||
@@ -118,7 +109,6 @@ export class DbosExecutor extends EventEmitter {
|
||||
}
|
||||
|
||||
getTranscodeConcurrencyLimit(): number {
|
||||
if (this.onceMode) return 1
|
||||
return getConcurrencyLimit(process.env.CONCURRENCY_TRANSCODE, 1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user