mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 20:54:33 +00:00
perf(core): speed up routing, pairing, slack, and security scans
This commit is contained in:
@@ -188,19 +188,30 @@ export function loadPluginManifestRegistry(params: {
|
||||
}
|
||||
|
||||
const configSchema = manifest.configSchema;
|
||||
const manifestMtime = safeStatMtimeMs(manifestRes.manifestPath);
|
||||
const schemaCacheKey = manifestMtime
|
||||
? `${manifestRes.manifestPath}:${manifestMtime}`
|
||||
: manifestRes.manifestPath;
|
||||
const schemaCacheKey = (() => {
|
||||
if (!configSchema) {
|
||||
return undefined;
|
||||
}
|
||||
const manifestMtime = safeStatMtimeMs(manifestRes.manifestPath);
|
||||
return manifestMtime
|
||||
? `${manifestRes.manifestPath}:${manifestMtime}`
|
||||
: manifestRes.manifestPath;
|
||||
})();
|
||||
|
||||
const existing = seenIds.get(manifest.id);
|
||||
if (existing) {
|
||||
// Check whether both candidates point to the same physical directory
|
||||
// (e.g. via symlinks or different path representations). If so, this
|
||||
// is a false-positive duplicate and can be silently skipped.
|
||||
const existingReal = safeRealpathSync(existing.candidate.rootDir, realpathCache);
|
||||
const candidateReal = safeRealpathSync(candidate.rootDir, realpathCache);
|
||||
const samePlugin = Boolean(existingReal && candidateReal && existingReal === candidateReal);
|
||||
const samePath = existing.candidate.rootDir === candidate.rootDir;
|
||||
const samePlugin = (() => {
|
||||
if (samePath) {
|
||||
return true;
|
||||
}
|
||||
const existingReal = safeRealpathSync(existing.candidate.rootDir, realpathCache);
|
||||
const candidateReal = safeRealpathSync(candidate.rootDir, realpathCache);
|
||||
return Boolean(existingReal && candidateReal && existingReal === candidateReal);
|
||||
})();
|
||||
if (samePlugin) {
|
||||
// Prefer higher-precedence origins even if candidates are passed in
|
||||
// an unexpected order (config > workspace > global > bundled).
|
||||
|
||||
Reference in New Issue
Block a user