修复使用redis存储时无法删除接口的BUG

This commit is contained in:
mxd
2021-04-13 20:08:48 +08:00
parent 74f52de754
commit 59ab374a48

View File

@@ -74,7 +74,13 @@ public abstract class KeyValueResource implements Resource {
@Override
public boolean delete() {
return !readonly() && this.keys().stream().allMatch(this::deleteByKey);
if(readonly()){
return false;
}
if(isDirectory()){
return this.keys().stream().allMatch(this::deleteByKey);
}
return deleteByKey(getAbsolutePath());
}
protected boolean deleteByKey(String key) {