We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb8946c commit 37949a7Copy full SHA for 37949a7
src/tools/actor.ts
@@ -89,15 +89,15 @@ export async function getNormalActorsAsTools(
89
apifyToken: string,
90
): Promise<ToolWrap[]> {
91
const tools: ToolWrap[] = [];
92
- const actorsLoadedFromCache: string[] = [];
+ const actorsToLoad: string[] = [];
93
for (const actorID of actors) {
94
const cacheEntry = normalActorToolsCache.get(actorID);
95
if (cacheEntry && cacheEntry.expiresAt > Date.now()) {
96
tools.push(cacheEntry.tool);
97
- actorsLoadedFromCache.push(actorID);
+ } else {
98
+ actorsToLoad.push(actorID);
99
}
100
- const actorsToLoad = actors.filter((actorID) => !actorsLoadedFromCache.includes(actorID));
101
if (actorsToLoad.length === 0) {
102
return tools;
103
0 commit comments