Skip to content
Snippets Groups Projects
Commit 5893333a authored by brinn's avatar brinn
Browse files

Fix: ensure the LazyPathHandler is kept running when an unexpected exception occurs

SVN: 1687
parent 4a263b2c
No related branches found
No related tags found
No related merge requests found
......@@ -73,21 +73,28 @@ public class LazyPathHandler implements ITerminable, IPathHandler
@Override
public void run()
{
while (terminate == false)
try
{
try
while (terminate == false)
{
File resource = queue.take(); // blocks if empty
boolean ok = handler.handle(resource);
logHandlingResult(resource, ok);
} catch (InterruptedException ex)
{
if (!terminate)
try
{
File resource = queue.take(); // blocks if empty
boolean ok = handler.handle(resource);
logHandlingResult(resource, ok);
} catch (InterruptedException ex)
{
operationLog.info("Processing was unexpectedly interrupted. Thread stops.");
if (!terminate)
{
operationLog.info("Processing was unexpectedly interrupted. Thread stops.");
}
return;
}
return;
}
} catch (Exception ex)
{
// Just log it but ensure that the thread won't die.
notificationLog.error("An exception has occurred. (thread still running)", ex);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment