File tree Expand file tree Collapse file tree
packages/project/lib/build/cache Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -532,7 +532,7 @@ export default class BuildTaskCache {
532532 resourceIndex : resourceIndex . toCacheObject ( ) ,
533533 } ) ;
534534 } else {
535- const rootResourceIndex = this . #resourceRequests. getMetadata ( parentId ) ;
535+ const { resourceIndex : rootResourceIndex } = this . #resourceRequests. getMetadata ( parentId ) ;
536536 if ( ! rootResourceIndex ) {
537537 throw new Error ( `Missing root resource index for parent ID ${ parentId } ` ) ;
538538 }
Original file line number Diff line number Diff line change @@ -182,6 +182,9 @@ export default class ProjectBuildCache {
182182 const deltaStageCache = await this . #findStageCache( stageName , [ deltaInfo . originalSignature ] ) ;
183183 if ( deltaStageCache ) {
184184 log . verbose ( `Using delta cached stage for task ${ taskName } in project ${ this . #project. getName ( ) } ` ) ;
185+
186+ // Store current project reader for later use in recordTaskResult
187+ this . #currentProjectReader = this . #project. getReader ( ) ;
185188 return {
186189 previousStageCache : deltaStageCache ,
187190 newSignature : deltaInfo . newSignature ,
@@ -190,10 +193,12 @@ export default class ProjectBuildCache {
190193 } ;
191194 }
192195 }
196+ } else {
197+ // Store current project reader for later use in recordTaskResult
198+ this . #currentProjectReader = this . #project. getReader ( ) ;
199+
200+ return false ; // Task needs to be executed
193201 }
194- // No cached stage found, store current project reader for later use in recordTaskResult
195- this . #currentProjectReader = this . #project. getReader ( ) ;
196- return false ; // Task needs to be executed
197202 }
198203
199204 /**
Original file line number Diff line number Diff line change @@ -205,6 +205,15 @@ export default class ResourceIndex {
205205 return await this . #tree. upsertResources ( resources ) ;
206206 }
207207
208+ /**
209+ * Removes resources from the index.
210+ *
211+ * @param {Array<string> } resourcePaths - Paths of resources to remove
212+ */
213+ async removeResources ( resourcePaths ) {
214+ return await this . #tree. removeResources ( resourcePaths ) ;
215+ }
216+
208217 /**
209218 * Computes the signature hash for this resource index.
210219 *
You can’t perform that action at this time.
0 commit comments