feat(transcode): support idle-timeout auto-drain for KEDA scaled jobs

This commit is contained in:
yiling
2026-10-19 09:23:17 +08:00
parent a16a1515d7
commit 8e3522eab6
7 changed files with 61 additions and 56 deletions
@@ -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)
}