mirror of
https://github.com/getpaseo/paseo.git
synced 2026-08-14 20:32:46 +00:00
chore(lint): parallelize Claude persisted agents lookup
Replace sequential parseClaudeSessionDescriptor loop with Promise.all to fix no-await-in-loop warning.
This commit is contained in:
@@ -1193,19 +1193,14 @@ export class ClaudeAgentClient implements AgentClient {
|
|||||||
}
|
}
|
||||||
const limit = options?.limit ?? 20;
|
const limit = options?.limit ?? 20;
|
||||||
const candidates = await collectRecentClaudeSessions(projectsRoot, limit * 3);
|
const candidates = await collectRecentClaudeSessions(projectsRoot, limit * 3);
|
||||||
const descriptors: PersistedAgentDescriptor[] = [];
|
const parsed = await Promise.all(
|
||||||
|
candidates.map((candidate) =>
|
||||||
for (const candidate of candidates) {
|
parseClaudeSessionDescriptor(candidate.path, candidate.mtime),
|
||||||
const descriptor = await parseClaudeSessionDescriptor(candidate.path, candidate.mtime);
|
),
|
||||||
if (descriptor) {
|
);
|
||||||
descriptors.push(descriptor);
|
return parsed
|
||||||
}
|
.filter((descriptor): descriptor is PersistedAgentDescriptor => descriptor !== null)
|
||||||
if (descriptors.length >= limit) {
|
.slice(0, limit);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return descriptors;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async isAvailable(): Promise<boolean> {
|
async isAvailable(): Promise<boolean> {
|
||||||
|
|||||||
Reference in New Issue
Block a user