Skip to content

Commit

Permalink
Remove read directory cache
Browse files Browse the repository at this point in the history
  • Loading branch information
abrenneke committed Oct 5, 2023
1 parent b16a7a4 commit bedcbea
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions packages/core/src/model/nodes/ReadDirectoryNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,6 @@ export class ReadDirectoryNodeImpl extends NodeImpl<ReadDirectoryNode> {
? expectType(inputData['ignores' as PortId], 'string[]')
: this.chartNode.data.ignores;

// Can be slow, assume a directory doesn't change during execution
// TODO once this is at auto-gpt level changing files, will need to rethink, but good enough
// for now
const cacheKey = `ReadDirectoryNode-${path}-${recursive}-${includeDirectories}-${filterGlobs.join()}-${relative}-${ignores?.join()}`;
const cached = context.executionCache.get(cacheKey);
if (cached) {
return cached as Outputs;
}

try {
const files = await nativeApi.readdir(path, undefined, {
recursive,
Expand All @@ -207,8 +198,6 @@ export class ReadDirectoryNodeImpl extends NodeImpl<ReadDirectoryNode> {
['rootPath' as PortId]: { type: 'string', value: path },
};

context.executionCache.set(cacheKey, outputs);

return outputs;
} catch (err) {
const outputs: Outputs = {
Expand Down

0 comments on commit bedcbea

Please sign in to comment.