mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 17:09:27 +00:00
refactor(workflow-core): statically import Worker type from @temporalio/worker to ensure activeWorkers type-safety
This commit is contained in:
@@ -7,9 +7,11 @@ import { LocalExecutor } from './local-executor'
|
||||
import { TemporalExecutor } from './temporal-executor'
|
||||
import { TaskQueueAgent, TaskQueueTranscode, getConcurrencyLimit } from './workflow-utils'
|
||||
|
||||
import type { Worker } from '@temporalio/worker'
|
||||
|
||||
export class WorkflowService {
|
||||
private executor: Executor
|
||||
private activeWorkers: unknown[] = []
|
||||
private activeWorkers: Worker[] = []
|
||||
|
||||
constructor() {
|
||||
const type = process.env.WORKFLOW_EXECUTOR || 'local'
|
||||
@@ -74,9 +76,7 @@ export class WorkflowService {
|
||||
}
|
||||
|
||||
async shutdownWorkers(): Promise<void> {
|
||||
await Promise.all(
|
||||
this.activeWorkers.map((w) => (w as { shutdown: () => Promise<void> }).shutdown()),
|
||||
)
|
||||
await Promise.all(this.activeWorkers.map((w) => w.shutdown()))
|
||||
this.activeWorkers = []
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user