mirror of https://github.com/halo-dev/halo
Fix the problem of upgrading plugins with same version (#3836)
#### What type of PR is this? /kind bug /area plugin /area core #### What this PR does / why we need it: Close file system after reading plugin descriptor. #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3720 #### How to test? 1. Build a plugin and install it 2. Update plugin.yaml of the plugin, rebuild and upgrade it 3. Check the change you modified #### Does this PR introduce a user-facing change? ```release-note 修复无法正常升级插件的问题 ```pull/3832/merge
parent
66eb0bb622
commit
60040ae428
|
@ -73,6 +73,7 @@ public class YamlPluginFinder {
|
||||||
|
|
||||||
protected Plugin readPluginDescriptor(Path pluginPath) {
|
protected Plugin readPluginDescriptor(Path pluginPath) {
|
||||||
Path propertiesPath = getManifestPath(pluginPath, propertiesFileName);
|
Path propertiesPath = getManifestPath(pluginPath, propertiesFileName);
|
||||||
|
try {
|
||||||
if (propertiesPath == null) {
|
if (propertiesPath == null) {
|
||||||
throw new PluginRuntimeException("Cannot find the plugin manifest path");
|
throw new PluginRuntimeException("Cannot find the plugin manifest path");
|
||||||
}
|
}
|
||||||
|
@ -83,6 +84,9 @@ public class YamlPluginFinder {
|
||||||
}
|
}
|
||||||
Resource propertyResource = new FileSystemResource(propertiesPath);
|
Resource propertyResource = new FileSystemResource(propertiesPath);
|
||||||
return unstructuredToPlugin(propertyResource);
|
return unstructuredToPlugin(propertyResource);
|
||||||
|
} finally {
|
||||||
|
FileUtils.closePath(propertiesPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Plugin unstructuredToPlugin(Resource propertyResource) {
|
protected Plugin unstructuredToPlugin(Resource propertyResource) {
|
||||||
|
|
Loading…
Reference in New Issue