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

[DMV-31] avoid hanging if we have only items left that we cannot handle

SVN: 7194
parent 822ba665
No related branches found
No related tags found
No related merge requests found
...@@ -200,11 +200,12 @@ public final class DirectoryScanningTimerTask extends TimerTask ...@@ -200,11 +200,12 @@ public final class DirectoryScanningTimerTask extends TimerTask
} }
try try
{ {
int numberOfItems; int numberOfItemsHandled;
do do
{ {
final StoreItem[] storeItems = listStoreItems(); final StoreItem[] storeItems = listStoreItems();
numberOfItems = storeItems.length; final int numberOfItems = storeItems.length;
numberOfItemsHandled = numberOfItems;
directoryScanningHandler.beforeHandle(); directoryScanningHandler.beforeHandle();
for (int i = 0; i < numberOfItems; i++) for (int i = 0; i < numberOfItems; i++)
{ {
...@@ -241,6 +242,7 @@ public final class DirectoryScanningTimerTask extends TimerTask ...@@ -241,6 +242,7 @@ public final class DirectoryScanningTimerTask extends TimerTask
} }
} else } else
{ {
--numberOfItemsHandled;
if (operationLog.isTraceEnabled()) if (operationLog.isTraceEnabled())
{ {
operationLog.trace(String.format( operationLog.trace(String.format(
...@@ -248,7 +250,7 @@ public final class DirectoryScanningTimerTask extends TimerTask ...@@ -248,7 +250,7 @@ public final class DirectoryScanningTimerTask extends TimerTask
} }
} }
} }
} while (numberOfItems > 0); } while (numberOfItemsHandled > 0);
} catch (final Exception ex) } catch (final Exception ex)
{ {
printNotification(ex); printNotification(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