Skip to content

Commit

Permalink
fix: memoize memory leak (#5137)
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 106eb72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/tasks/base.ts
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 106eb72

Please sign in to comment.