Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Cronjob): don't restart CasparCG using the nightly cronjob if there's a Rundown active in the Studio (SOFIE-3618) #1365

Merged

Conversation

jstarpl
Copy link
Member

@jstarpl jstarpl commented Jan 24, 2025

About the Contributor

Type of Contribution

This is a:

Bug fix

Current Behavior

CasparCG servers will be restarted during "Low Season" (between 4:00 and 5:00) if the CasparCG restart cronjob is enabled

New Behavior

CasparCG cronjob will check if there's an active rundown in the Studio that owns the CasparCG to be restarted. If there is, the restart will be skipped until next day.

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

Time Frame

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

…re's a Rundown active in the Studio

Skip until next day.
@jstarpl jstarpl requested a review from a team as a code owner January 24, 2025 10:56
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.50%. Comparing base (054dcb1) to head (98e199c).
Report is 18 commits behind head on release52.

Additional details and impacted files
@@              Coverage Diff              @@
##           release52    #1365      +/-   ##
=============================================
+ Coverage      56.48%   56.50%   +0.01%     
=============================================
  Files            401      401              
  Lines          72257    72296      +39     
  Branches        4170     4595     +425     
=============================================
+ Hits           40816    40852      +36     
- Misses         31204    31309     +105     
+ Partials         237      135     -102     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 112 to 117
RundownPlaylists.findFetchAsync(
{
activationId: {
$exists: true,
},
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is perhaps nit-picking, as most/all Sofie installations we know of are single-studio at the moment, but since the data model allows for multi-studio:

This query will fail to match any indexes we've set up in MongoDB. Could we instead first query for the PeripheralDevices, and then use their studioId to filter in the query?

{
  studioId: {$in: relevantStudioIds },
  activationId: { $exists: true }
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess I wanted to be fancy, but I'm good with doing this in series.

@jstarpl jstarpl merged commit 94af13a into release52 Jan 29, 2025
67 checks passed
@jstarpl jstarpl deleted the fix/sofie-3618/casparcg-restarts-when-rundown-active branch January 29, 2025 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants