Skip to content

Commit

Permalink
Merge pull request #2821 from PrefectHQ/dylan/chore/update-workpoolwo…
Browse files Browse the repository at this point in the history
…rker-type

Chore: update WorkPoolWorker to include better typing for metadata
  • Loading branch information
dylanbhughes authored Nov 12, 2024
2 parents cfb8c8f + fbc8780 commit bf5d918
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/models/WorkPoolWorker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { WorkPoolWorkerStatus } from '@/models/WorkPoolWorkerStatus'

type Integration = { name: string, version: string }
type Metadata = Record<string, unknown> & { integrations?: Integration[] }

export interface IWorkPoolWorker {
readonly id: string,
created: Date,
Expand All @@ -10,7 +13,7 @@ export interface IWorkPoolWorker {
status: WorkPoolWorkerStatus,
heartbeatIntervalSeconds: number,
clientVersion: string | null,
metadata: Record<string, unknown> | null,
metadata: Metadata | null,
}

export class WorkPoolWorker implements IWorkPoolWorker {
Expand Down

0 comments on commit bf5d918

Please sign in to comment.