Skip to content

Commit 29be5da

Browse files
authored
Merge pull request #1623 from tv2norge-collab/contribute/EAV-730
feat: allow custom timeout on TSR actions
2 parents 4b6a43c + c77557e commit 29be5da

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

packages/blueprints-integration/src/context/executeTsrActionContext.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export interface IExecuteTSRActionsContext {
88
executeTSRAction(
99
deviceId: PeripheralDeviceId,
1010
actionId: string,
11-
payload: Record<string, any>
11+
payload: Record<string, any>,
12+
/** Timeout for the action, default: 3000 */
13+
timeoutMs?: number
1214
): Promise<TSR.ActionExecutionResult>
1315
}

packages/job-worker/src/blueprints/context/OnTakeContext.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,10 @@ export class OnTakeContext extends ShowStyleUserContext implements IOnTakeContex
163163
async executeTSRAction(
164164
deviceId: PeripheralDeviceId,
165165
actionId: string,
166-
payload: Record<string, any>
166+
payload: Record<string, any>,
167+
timeoutMs?: number
167168
): Promise<TSR.ActionExecutionResult> {
168-
return executePeripheralDeviceAction(this._context, deviceId, null, actionId, payload)
169+
return executePeripheralDeviceAction(this._context, deviceId, timeoutMs ?? null, actionId, payload)
169170
}
170171

171172
queuePartAfterTake(rawPart: IBlueprintPart, rawPieces: IBlueprintPiece[]): void {

packages/job-worker/src/blueprints/context/RundownActivationContext.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ export class RundownActivationContext extends RundownEventContext implements IRu
5959
async executeTSRAction(
6060
deviceId: PeripheralDeviceId,
6161
actionId: string,
62-
payload: Record<string, any>
62+
payload: Record<string, any>,
63+
timeoutMs?: number
6364
): Promise<TSR.ActionExecutionResult> {
64-
return executePeripheralDeviceAction(this._context, deviceId, null, actionId, payload)
65+
return executePeripheralDeviceAction(this._context, deviceId, timeoutMs ?? null, actionId, payload)
6566
}
6667

6768
async setTimelineDatastoreValue(key: string, value: unknown, mode: DatastorePersistenceMode): Promise<void> {

packages/job-worker/src/blueprints/context/adlibActions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,10 @@ export class ActionExecutionContext extends ShowStyleUserContext implements IAct
260260
async executeTSRAction(
261261
deviceId: PeripheralDeviceId,
262262
actionId: string,
263-
payload: Record<string, any>
263+
payload: Record<string, any>,
264+
timeoutMs?: number
264265
): Promise<TSR.ActionExecutionResult> {
265-
return executePeripheralDeviceAction(this._context, deviceId, null, actionId, payload)
266+
return executePeripheralDeviceAction(this._context, deviceId, timeoutMs ?? null, actionId, payload)
266267
}
267268

268269
async setTimelineDatastoreValue(key: string, value: unknown, mode: DatastorePersistenceMode): Promise<void> {

0 commit comments

Comments
 (0)