Added div-zero safegaurd
@@ -120,6 +120,7 @@ class PolicyLive(FileEventHandler):
if time_elapsed < self.RATE_LIMIT_SECONDS:
return time_elapsed
# Check rate limit by size increase
+ if float(self._last_uploaded_size) > 0:
size_increase = self.current_size / float(self._last_uploaded_size)
if size_increase < self.RATE_LIMIT_SIZE_INCREASE:
return time_elapsed
