fix: prevent redundant plugin path checks for /usr/bin directory
This commit is contained in:
+5
-2
@@ -137,8 +137,11 @@ impl PluginRegistry {
|
||||
Ok(executable) => {
|
||||
tracing::trace!(executable = %executable.display(), "resolved current executable");
|
||||
if let Some(parent) = executable.parent() {
|
||||
directories.push(parent.to_path_buf());
|
||||
directories.push(parent.join("plugins"));
|
||||
// Avoids checking the entire /usr/bin folder on every runtime, since there will never be a lib file there
|
||||
if parent.to_path_buf() != PathBuf::from("/usr/bin") {
|
||||
directories.push(parent.to_path_buf());
|
||||
directories.push(parent.join("plugins"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(error) => tracing::debug!(%error, "could not resolve current executable"),
|
||||
|
||||
Reference in New Issue
Block a user