Skip to content

Commit e4a2cee

Browse files
committed
wip: remove broken debug method
1 parent 53486ca commit e4a2cee

File tree

5 files changed

+4
-76
lines changed

5 files changed

+4
-76
lines changed

meteor/server/api/ingest/debug.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { QueueStudioJob } from '../../worker/worker'
88
import { StudioJobs } from '@sofie-automation/corelib/dist/worker/studio'
99
import { RundownPlaylistId, SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids'
1010
import { MeteorDebugMethods } from '../../methods'
11-
import { DBRundown } from '@sofie-automation/corelib/dist/dataModel/Rundown'
1211

1312
MeteorDebugMethods({
1413
/**
@@ -47,31 +46,4 @@ MeteorDebugMethods({
4746
segmentExternalId: segment.externalId,
4847
})
4948
},
50-
/**
51-
* Regenerate all the expected packages for all rundowns in the system.
52-
* Additionally it will recreate any expectedMediaItems and expectedPlayoutItems.
53-
* This shouldn't be necessary as ingest will do this for each rundown as part of its workflow
54-
*/
55-
debug_recreateExpectedPackages: async () => {
56-
const rundowns = (await Rundowns.findFetchAsync(
57-
{},
58-
{
59-
projection: {
60-
_id: 1,
61-
studioId: 1,
62-
source: 1,
63-
},
64-
}
65-
)) as Array<Pick<DBRundown, '_id' | 'studioId' | 'source'>>
66-
67-
await Promise.all(
68-
rundowns
69-
.filter((rundown) => rundown.source.type !== 'snapshot')
70-
.map(async (rundown) =>
71-
runIngestOperation(rundown.studioId, IngestJobs.ExpectedPackagesRegenerate, {
72-
rundownId: rundown._id,
73-
})
74-
)
75-
)
76-
},
7749
})

packages/corelib/src/worker/ingest.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ export enum IngestJobs {
105105
*/
106106
MosSwapStory = 'mosSwapStory',
107107

108-
/**
109-
* Debug: Regenerate ExpectedPackages for a Rundown
110-
*/
111-
ExpectedPackagesRegenerate = 'expectedPackagesRegenerate',
112108
/**
113109
* Some PackageInfos have been updated, regenerate any Parts which depend on these PackageInfos
114110
*/
@@ -230,9 +226,6 @@ export interface MosSwapStoryProps extends IngestPropsBase {
230226
story1: MOS.IMOSString128
231227
}
232228

233-
export interface ExpectedPackagesRegenerateProps {
234-
rundownId: RundownId
235-
}
236229
export interface PackageInfosUpdatedRundownProps extends IngestPropsBase {
237230
packageIds: ExpectedPackageId[]
238231
}
@@ -313,7 +306,6 @@ export type IngestJobFunc = {
313306
[IngestJobs.MosMoveStory]: (data: MosMoveStoryProps) => void
314307
[IngestJobs.MosSwapStory]: (data: MosSwapStoryProps) => void
315308

316-
[IngestJobs.ExpectedPackagesRegenerate]: (data: ExpectedPackagesRegenerateProps) => void
317309
[IngestJobs.PackageInfosUpdatedRundown]: (data: PackageInfosUpdatedRundownProps) => void
318310

319311
[IngestJobs.UserRemoveRundown]: (data: UserRemoveRundownProps) => void

packages/job-worker/src/ingest/model/implementation/SaveIngestModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ export class SaveIngestModelHelper {
9292
}
9393
}
9494

95-
function transformIngestExpectedPackageToDb(
95+
async function transformIngestExpectedPackageToDb(
9696
context: JobContext,
9797
docs: IngestExpectedPackage<any>[]
98-
): ExpectedPackageDBNew[] {
98+
): Promise<ExpectedPackageDBNew[]> {
9999
return docs.map((doc) => ({
100100
...doc,
101101
studioId: context.studioId,

packages/job-worker/src/ingest/packageInfo.ts

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,12 @@
11
import { ExpectedPackageDBType } from '@sofie-automation/corelib/dist/dataModel/ExpectedPackages'
22
import { SegmentId } from '@sofie-automation/corelib/dist/dataModel/Ids'
3-
import {
4-
ExpectedPackagesRegenerateProps,
5-
PackageInfosUpdatedRundownProps,
6-
} from '@sofie-automation/corelib/dist/worker/ingest'
3+
import { PackageInfosUpdatedRundownProps } from '@sofie-automation/corelib/dist/worker/ingest'
74
import { logger } from '../logging'
85
import { JobContext } from '../jobs'
96
import { regenerateSegmentsFromIngestData } from './generationSegment'
10-
import { runWithRundownLock } from './lock'
11-
import {
12-
updateExpectedMediaAndPlayoutItemsForPartModel,
13-
updateExpectedMediaAndPlayoutItemsForRundownBaseline,
14-
} from './expectedPackages'
15-
import { loadIngestModelFromRundown } from './model/implementation/LoadIngestModel'
167
import { runCustomIngestUpdateOperation } from './runOperation'
178
import { assertNever } from '@sofie-automation/corelib/dist/lib'
189

19-
/**
20-
* Debug: Regenerate ExpectedPackages for a Rundown
21-
*/
22-
export async function handleExpectedPackagesRegenerate(
23-
context: JobContext,
24-
data: ExpectedPackagesRegenerateProps
25-
): Promise<void> {
26-
return runWithRundownLock(context, data.rundownId, async (rundown, rundownLock) => {
27-
if (!rundown) throw new Error(`Rundown "${data.rundownId}" not found`)
28-
29-
// TODO - this needs to be run inside a playlistLock
30-
31-
const ingestModel = await loadIngestModelFromRundown(context, rundownLock, rundown)
32-
33-
// nocommit reimplement this for packages
34-
35-
for (const part of ingestModel.getAllOrderedParts()) {
36-
updateExpectedMediaAndPlayoutItemsForPartModel(context, part)
37-
}
38-
39-
await updateExpectedMediaAndPlayoutItemsForRundownBaseline(context, ingestModel, undefined)
40-
41-
await ingestModel.saveAllToDatabase(rundownLock as any) // nocommit
42-
})
43-
}
44-
4510
/**
4611
* Some PackageInfos have been updated, regenerate any Parts which depend on these PackageInfos
4712
*/

packages/job-worker/src/workers/ingest/jobs.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
handleUpdatedSegment,
3030
handleUpdatedSegmentRanks,
3131
} from '../../ingest/ingestSegmentJobs'
32-
import { handleExpectedPackagesRegenerate, handleUpdatedPackageInfoForRundown } from '../../ingest/packageInfo'
32+
import { handleUpdatedPackageInfoForRundown } from '../../ingest/packageInfo'
3333
import {
3434
handleBucketActionModify,
3535
handleBucketActionRegenerateExpectedPackages,
@@ -81,7 +81,6 @@ export const ingestJobHandlers: IngestJobHandlers = {
8181
[IngestJobs.MosMoveStory]: wrapMosIngestJob(handleMosMoveStories),
8282
[IngestJobs.MosSwapStory]: wrapMosIngestJob(handleMosSwapStories),
8383

84-
[IngestJobs.ExpectedPackagesRegenerate]: handleExpectedPackagesRegenerate,
8584
[IngestJobs.PackageInfosUpdatedRundown]: handleUpdatedPackageInfoForRundown,
8685

8786
[IngestJobs.UserRemoveRundown]: handleUserRemoveRundown,

0 commit comments

Comments
 (0)