mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-07-07 00:09:46 +03:00
[FIX] pushUpdate: UnsupportedOperationException
This commit is contained in:
parent
bd0423460f
commit
26c21a3ec7
1 changed files with 3 additions and 3 deletions
|
@ -182,7 +182,7 @@ private void writeCache(Path file) throws IOException {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void readCache(Path file) throws IOException {
|
private void readCache(Path file) throws IOException {
|
||||||
Map<String, HashedDir> updatesDirMap = new HashMap<>(16);
|
Map<String, HashedDir> updatesDirMap = new ConcurrentHashMap<>(16);
|
||||||
try (HInput input = new HInput(IOHelper.newInput(file))) {
|
try (HInput input = new HInput(IOHelper.newInput(file))) {
|
||||||
int size = input.readLength(0);
|
int size = input.readLength(0);
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
|
@ -192,7 +192,7 @@ private void readCache(Path file) throws IOException {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.debug("Found {} updates from cache", updatesDirMap.size());
|
logger.debug("Found {} updates from cache", updatesDirMap.size());
|
||||||
this.updatesDirMap = Collections.unmodifiableMap(updatesDirMap);
|
this.updatesDirMap = updatesDirMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readProfilesDir() throws IOException {
|
public void readProfilesDir() throws IOException {
|
||||||
|
@ -248,7 +248,7 @@ public void sync(Collection<String> dirs) throws IOException {
|
||||||
newUpdatesDirMap.put(name, updateHDir);
|
newUpdatesDirMap.put(name, updateHDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updatesDirMap = Collections.unmodifiableMap(newUpdatesDirMap);
|
updatesDirMap = newUpdatesDirMap;
|
||||||
if (cacheUpdates) {
|
if (cacheUpdates) {
|
||||||
try {
|
try {
|
||||||
writeCache(Path.of(cacheFile));
|
writeCache(Path.of(cacheFile));
|
||||||
|
|
Loading…
Reference in a new issue