Permalink
Browse files

timeout for 1 image conversion

  • Loading branch information...
1 parent 921bc0f commit 2cf626df7ca7b1bc03499c5e02cb118d92dad5d9 @Jiri-Kremser Jiri-Kremser committed Apr 30, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 editor-converter/src/main/java/cz/mzk/editor/server/convert/Converter.java
@@ -55,6 +55,7 @@
private Map<String, ConvertTask> taskPool = new ConcurrentHashMap<String, ConvertTask>();
private Map<String, ConvertTask> finishedWithError = new ConcurrentHashMap<String, ConvertTask>();
private volatile boolean someoneIsIn = false;
+ private static int MAX_CONVERSION_TIME = 1000 * 15;
private static Converter instance = null;
@@ -103,7 +104,7 @@ public boolean convert(String input, String output) {
taskPool.put(uuid, task);
synchronized (task) {
try {
- task.wait();
+ task.wait(MAX_CONVERSION_TIME);
} catch (InterruptedException e) {
e.printStackTrace();
}

0 comments on commit 2cf626d

Please sign in to comment.