1.0.42 - Increase album download timeout to 1 hour

Hopefully corrects the issue with large-album-rips from #35
This commit is contained in:
4pr0n 2014-05-16 20:21:40 -07:00
parent 339aa8935d
commit 1aaefcccc8
3 changed files with 6 additions and 7 deletions

View File

@ -4,7 +4,7 @@
<groupId>com.rarchives.ripme</groupId> <groupId>com.rarchives.ripme</groupId>
<artifactId>ripme</artifactId> <artifactId>ripme</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.0.41</version> <version>1.0.42</version>
<name>ripme</name> <name>ripme</name>
<url>http://rip.rarchives.com</url> <url>http://rip.rarchives.com</url>
<properties> <properties>

View File

@ -1,7 +1,7 @@
package com.rarchives.ripme.ripper; package com.rarchives.ripme.ripper;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -14,7 +14,7 @@ import com.rarchives.ripme.utils.Utils;
public class DownloadThreadPool { public class DownloadThreadPool {
private static final Logger logger = Logger.getLogger(DownloadThreadPool.class); private static final Logger logger = Logger.getLogger(DownloadThreadPool.class);
private ExecutorService threadPool = null; private ThreadPoolExecutor threadPool = null;
public DownloadThreadPool() { public DownloadThreadPool() {
initialize("Main"); initialize("Main");
@ -27,7 +27,7 @@ public class DownloadThreadPool {
private void initialize(String threadPoolName) { private void initialize(String threadPoolName) {
int threads = Utils.getConfigInteger("threads.size", 10); int threads = Utils.getConfigInteger("threads.size", 10);
logger.debug("Initializing " + threadPoolName + " thread pool with " + threads + " threads"); logger.debug("Initializing " + threadPoolName + " thread pool with " + threads + " threads");
threadPool = Executors.newFixedThreadPool(threads); threadPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(threads);
} }
public void addThread(Thread t) { public void addThread(Thread t) {
@ -37,8 +37,7 @@ public class DownloadThreadPool {
public void waitForThreads() { public void waitForThreads() {
threadPool.shutdown(); threadPool.shutdown();
try { try {
// XXX What if some rips take longer than 120 seconds to complete? threadPool.awaitTermination(3600, TimeUnit.SECONDS);
threadPool.awaitTermination(120, TimeUnit.SECONDS);
} catch (InterruptedException e) { } catch (InterruptedException e) {
logger.error("[!] Interrupted while waiting for threads to finish: ", e); logger.error("[!] Interrupted while waiting for threads to finish: ", e);
} }

View File

@ -21,7 +21,7 @@ import com.rarchives.ripme.utils.Utils;
public class UpdateUtils { public class UpdateUtils {
private static final Logger logger = Logger.getLogger(UpdateUtils.class); 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 updateJsonURL = "http://rarchives.com/ripme.json";
private static final String updateJarURL = "http://rarchives.com/ripme.jar"; private static final String updateJarURL = "http://rarchives.com/ripme.jar";
private static final String mainFileName = "ripme.jar"; private static final String mainFileName = "ripme.jar";