mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-08-03 19:36:53 -04:00
update
This commit is contained in:
parent
9f0ccefeff
commit
685c1507f5
@ -261,12 +261,14 @@ public class CacheRepository {
|
||||
if (oldItem == null) {
|
||||
return newItem;
|
||||
} else if (force || oldItem.compareTo(newItem) < 0) {
|
||||
if (!oldItem.hash.equalsIgnoreCase(newItem.hash)) {
|
||||
Path cached = getFile(SHA1, oldItem.hash);
|
||||
try {
|
||||
Files.deleteIfExists(cached);
|
||||
} catch (IOException e) {
|
||||
LOG.warning("Cannot delete old file");
|
||||
}
|
||||
}
|
||||
return newItem;
|
||||
} else {
|
||||
return oldItem;
|
||||
|
Loading…
x
Reference in New Issue
Block a user