Skip to content

Commit

Permalink
1.0.42 - Increase album download timeout to 1 hour
Browse files Browse the repository at this point in the history
Hopefully corrects the issue with large-album-rips from #35
  • Loading branch information
4pr0n committed May 17, 2014
1 parent 339aa89 commit 1aaefcc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.rarchives.ripme</groupId>
<artifactId>ripme</artifactId>
<packaging>jar</packaging>
<version>1.0.41</version>
<version>1.0.42</version>
<name>ripme</name>
<url>http://rip.rarchives.com</url>
<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.rarchives.ripme.ripper;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import org.apache.log4j.Logger;
Expand All @@ -14,7 +14,7 @@
public class DownloadThreadPool {

private static final Logger logger = Logger.getLogger(DownloadThreadPool.class);
private ExecutorService threadPool = null;
private ThreadPoolExecutor threadPool = null;

public DownloadThreadPool() {
initialize("Main");
Expand All @@ -27,7 +27,7 @@ public DownloadThreadPool(String threadPoolName) {
private void initialize(String threadPoolName) {
int threads = Utils.getConfigInteger("threads.size", 10);
logger.debug("Initializing " + threadPoolName + " thread pool with " + threads + " threads");
threadPool = Executors.newFixedThreadPool(threads);
threadPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(threads);
}

public void addThread(Thread t) {
Expand All @@ -37,8 +37,7 @@ public void addThread(Thread t) {
public void waitForThreads() {
threadPool.shutdown();
try {
// XXX What if some rips take longer than 120 seconds to complete?
threadPool.awaitTermination(120, TimeUnit.SECONDS);
threadPool.awaitTermination(3600, TimeUnit.SECONDS);
} catch (InterruptedException e) {
logger.error("[!] Interrupted while waiting for threads to finish: ", e);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rarchives/ripme/ui/UpdateUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class UpdateUtils {

private static final Logger logger = Logger.getLogger(UpdateUtils.class);
private static final String DEFAULT_VERSION = "1.0.41";
private static final String DEFAULT_VERSION = "1.0.42";
private static final String updateJsonURL = "http://rarchives.com/ripme.json";
private static final String updateJarURL = "http://rarchives.com/ripme.jar";
private static final String mainFileName = "ripme.jar";
Expand Down

0 comments on commit 1aaefcc

Please sign in to comment.