feat: add object to timeline to trigger a regeneration at point in time #1384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the Contributor
This pull request is posted on behalf of the BBC
Type of Contribution
This is a: Feature
New Behavior
This is a half-feature, that doesn't make much sense on its own, but is a pretty isolated chunk of a larger feature.
This half-feature allows the timeline/playout-gateway to trigger a callback to regenerate the timeline. This is done with the same callback flow as we use for partinstances/pieceinstances, which has been expanded to use a new trigger type.
It uses a token which changes upon each generation of the timeline to minimise the risk of getting stuck in a regeneration loop where sofie and playout-gateway disagree about the current state/timeline.
The timeline generation logic does not currently create this object, but the flow is in place for it to define a
regenerateTimelineAt
value, which will cause the object to be created and timeline to be regenerated at that point in time. You can see this in action by forcing that value in the code to something likegetCurrentTime() + 10000
, and observe the timeline be regenerated every 10s.Our intention with this is to allow us to avoid putting certain pieces on the timeline until close to the time they are played, rather than them being on the timeline for the around an hour before they get played. By avoiding putting them on the timeline, we avoid these pieces taking part in AB resolving and lookahead.
Originally I was considering doing this by keeping some timer inside the job-worker to run the regeneration, but thought this better matched how things currently work. It would have been fine and not too messy to do inside the job-worker though.
Testing
Affected areas
Time Frame
Other Information
Status