cache service: move database updating to happen during download

This commit is contained in:
Adam
2018-01-19 09:45:36 -05:00
parent fff5f51077
commit 36acbebd1b
4 changed files with 55 additions and 44 deletions

View File

@@ -264,6 +264,11 @@ public class CacheClient implements AutoCloseable
logger.info("Index {} has {} archives", i, indexData.getArchives().length);
if (watcher != null)
{
watcher.indexComplete(index);
}
for (ArchiveData ad : indexData.getArchives())
{
Archive existing = index.getArchive(ad.getId());

View File

@@ -25,9 +25,11 @@
package net.runelite.cache.client;
import net.runelite.cache.fs.Archive;
import net.runelite.cache.fs.Index;
@FunctionalInterface
public interface DownloadWatcher
{
void indexComplete(Index index);
void downloadComplete(Archive archive, byte[] data);
}