File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1773,6 +1773,7 @@ def clean(self, timeout=60):
17731773 :return: The :class:`Index`.
17741774 """
17751775 self .refresh ()
1776+
17761777 tds = self ['maxTotalDataSizeMB' ]
17771778 ftp = self ['frozenTimePeriodInSecs' ]
17781779 was_disabled_initially = self .disabled
@@ -1785,22 +1786,23 @@ def clean(self, timeout=60):
17851786 self .update (maxTotalDataSizeMB = 1 , frozenTimePeriodInSecs = 1 )
17861787 self .roll_hot_buckets ()
17871788
1789+ # Wait until event count goes to 0.
17881790 start = datetime .now ()
17891791 diff = timedelta (seconds = timeout )
1790- # Wait until event count goes to 0.
17911792 while self .content .totalEventCount != '0' and datetime .now () < start + diff :
17921793 sleep (1 )
17931794 self .refresh ()
1795+
1796+ if self .content .totalEventCount != '0' :
1797+ raise OperationError , "Cleaning index %s took longer than %s seconds; timing out." % \
1798+ (self .name , timeout )
17941799 finally :
17951800 # Restore original values
17961801 self .update (maxTotalDataSizeMB = tds , frozenTimePeriodInSecs = ftp )
17971802 if (not was_disabled_initially and \
17981803 self .service .splunk_version < (5 ,)):
17991804 # Re-enable the index if it was originally enabled and we messed with it.
18001805 self .enable ()
1801- if self .content .totalEventCount != '0' :
1802- raise OperationError , "Cleaning index %s took longer than %s seconds; timing out." % \
1803- (self .name , timeout )
18041806
18051807 return self
18061808
You can’t perform that action at this time.
0 commit comments