Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai 79022560bd fix(plugins): warn once about a duplicate plugin directory
A plugin found both in an older location and a linked one logged "ignored: already
loaded from" on every rescan, tens of thousands of times a session. The warning is now
given once per plugin directory.

Refs #7207
2026-12-01 20:27:30 +08:00
+10 -5
Переглянути файл
@@ -3008,11 +3008,16 @@ impl PluginHost {
{
let mut plugins = self.plugins.write();
if let Some(existing) = plugins.get(&id) {
tracing::warn!(
"plugin {id:?} at {} ignored: already loaded from {}",
dir.display(),
existing.dir().display()
);
// Every rescan meets the same duplicate again: say it once per directory, not on each scan.
static WARNED: std::sync::LazyLock<Mutex<std::collections::HashSet<(String, PathBuf)>>> =
std::sync::LazyLock::new(Default::default);
if WARNED.lock().insert((id.clone(), dir.to_path_buf())) {
tracing::warn!(
"plugin {id:?} at {} ignored: already loaded from {}",
dir.display(),
existing.dir().display()
);
}
return (id, None);
}
plugins.insert(id.clone(), plugin.clone());