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