Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix installation of updates in some cases

  • Loading branch information...
commit 67d7b519a4850cb3c0b422dd5e95f135f7ac377e 1 parent 07b4b86
@Furyhunter authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/jp/pso2/PSO2Patcher.java
View
16 src/jp/pso2/PSO2Patcher.java
@@ -49,8 +49,8 @@ public void run() {
if (multithreaded) {
final Random rand = new Random();
- exec = new ScheduledThreadPoolExecutor(8);
- exec.setMaximumPoolSize(256);
+ exec = new ScheduledThreadPoolExecutor(32);
+ exec.setMaximumPoolSize(32);
ThreadFactory tf = new ThreadFactory() {
@Override
@@ -118,9 +118,8 @@ public Thread newThread(Runnable r) {
listener.setNumberOfOperations(numOps);
- boolean res;
- res = downloadPatches(launcherFiles);
- res = downloadPatches(patchFiles);
+ downloadPatches(launcherFiles);
+ downloadPatches(patchFiles);
if (errorFlag) {
return;
}
@@ -132,6 +131,7 @@ public Thread newThread(Runnable r) {
try {
System.out.println("waiting for termination");
r = exec.awaitTermination(5, TimeUnit.HOURS);
+ System.out.println("terminated");
downloadExec.shutdown();
downloadExec.awaitTermination(5, TimeUnit.HOURS);
} catch (InterruptedException e1) {
@@ -144,8 +144,8 @@ public Thread newThread(Runnable r) {
}
- if (install && res) {
-
+ if (install) {
+ System.out.println("installing");
installFiles(updatedFiles);
updatedFiles.clear();
}
@@ -220,7 +220,7 @@ public void run() {
public void run() {
try {
changed = true;
- //System.out.println("Downloading " + (float)((double)f.fileSize/1048576) + " MiB of data for " + f.localPath + "...");
+ System.out.println("Downloading " + (float)((double)f.fileSize/1048576) + " MiB of data for " + f.localPath + "...");
ReadableByteChannel rbc = Channels.newChannel(f.url.openStream());
File fff = new File(downloadDir + "\\" + f.localPath);
fff.getParentFile().mkdirs();
Please sign in to comment.
Something went wrong with that request. Please try again.