Skip to content

Commit 9842e83

Browse files
committed
wip
1 parent 67f8296 commit 9842e83

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ export class WatchedPackagesHelper {
146146

147147
/**
148148
* Create a new helper with a subset of the data in the current helper.
149-
* This is useful so that all the data for a rundown can be loaded at the start of an ingest operation, and then subsets can be taken for particular blueprint methods without needing to do more db operations.
149+
* This is useful so that all the data for a rundown can be loaded at the start of an ingest operation,
150+
* and then subsets can be taken for particular blueprint methods without needing to do more db operations.
150151
* @param func A filter to check if each package should be included
151152
*/
152153
filter(
@@ -171,9 +172,11 @@ export class WatchedPackagesHelper {
171172
}
172173

173174
getPackageInfo(blueprintPackageId: string): Readonly<Array<PackageInfo.Any>> {
174-
// nocommit - can this/should this do more scoping by source?
175+
// Perhaps this should do some scoped source checks, but this should not be necessary.
176+
// The caller should be ensuring that this helper has been filtered to only contain relevant packages
175177
for (const packages of this.packages.values()) {
176178
for (const pkg of packages) {
179+
// Note: This finds the first package with the same blueprintPackageId. There could be multiple if the blueprints don't respect the uniqueness rules.
177180
if (pkg.source.blueprintPackageId === blueprintPackageId) {
178181
const info = this.packageInfos.filter((p) => p.packageId === pkg.packageId)
179182
return unprotectObjectArray(info)

0 commit comments

Comments
 (0)