Skip to content

Commit 37949a7

Browse files
MQ37jirispilka
andauthored
Update src/tools/actor.ts
Co-authored-by: Jiří Spilka <[email protected]>
1 parent bb8946c commit 37949a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tools/actor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ export async function getNormalActorsAsTools(
8989
apifyToken: string,
9090
): Promise<ToolWrap[]> {
9191
const tools: ToolWrap[] = [];
92-
const actorsLoadedFromCache: string[] = [];
92+
const actorsToLoad: string[] = [];
9393
for (const actorID of actors) {
9494
const cacheEntry = normalActorToolsCache.get(actorID);
9595
if (cacheEntry && cacheEntry.expiresAt > Date.now()) {
9696
tools.push(cacheEntry.tool);
97-
actorsLoadedFromCache.push(actorID);
97+
} else {
98+
actorsToLoad.push(actorID);
9899
}
99100
}
100-
const actorsToLoad = actors.filter((actorID) => !actorsLoadedFromCache.includes(actorID));
101101
if (actorsToLoad.length === 0) {
102102
return tools;
103103
}

0 commit comments

Comments
 (0)