Skip to content

Commit

Permalink
fix: memoize memory leak
Browse files Browse the repository at this point in the history
Memoize was using an object as a cache key whose identity kept changing.
Thus it never returned a cache hit and kept storing new objects in cache.
With this fixed, memory consumption becomes a lot more reasonable, plus the cache actually yields the desired performance benefits.
  • Loading branch information
TimBeyer committed Sep 27, 2023
1 parent 8b8fc00 commit f95dd1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/tasks/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export abstract class BaseTask<O extends ValidResultType = ValidResultType> exte
/**
* Wrapper around resolveProcessDependencies() that memoizes the results and applies filters.
*/
@Memoize()
@Memoize((params: ResolveProcessDependenciesParams<O>) => params.status ? params.status.state : null)
getProcessDependencies(params: ResolveProcessDependenciesParams<O>): BaseTask[] {
if (this.skipDependencies) {
return []
Expand Down

0 comments on commit f95dd1a

Please sign in to comment.