Skip to content

Commit

Permalink
Merge pull request #2823 from PrefectHQ/dylan/bugfix/make-sure-all-ty…
Browse files Browse the repository at this point in the history
…pes-are-updated

BugFix: ensure all types are updated for workpoolworker
  • Loading branch information
dylanbhughes authored Nov 12, 2024
2 parents ee103d5 + 9622411 commit 4dfa3f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mocks/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const randomWorker: MockFunction<WorkPoolWorker, [Partial<WorkPoolWorker>
lastHeartbeatTime: this.create('date'),
status: this.create('workerStatus'),
clientVersion: this.create('string'),
metadata: { 'integrations': [this.create('string'), this.create('string')] },
metadata: { integrations: [{ name: this.create('string'), version: this.create('string') }], 'foo': 'bar' },
heartbeatIntervalSeconds: this.create('number'),
...overrides,
})
Expand Down
6 changes: 3 additions & 3 deletions src/models/WorkPoolWorker.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { WorkPoolWorkerStatus } from '@/models/WorkPoolWorkerStatus'

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

export interface IWorkPoolWorker {
readonly id: string,
Expand All @@ -27,7 +27,7 @@ export class WorkPoolWorker implements IWorkPoolWorker {
public status: WorkPoolWorkerStatus
public heartbeatIntervalSeconds: number
public clientVersion: string | null
public metadata: Record<string, unknown> | null
public metadata: Metadata | null

public constructor(workPoolWorker: IWorkPoolWorker) {
this.id = workPoolWorker.id
Expand Down

0 comments on commit 4dfa3f8

Please sign in to comment.