Skip to content

Commit

Permalink
fix: Allow floating values less than 1 and wait only for 50ms
Browse files Browse the repository at this point in the history
  • Loading branch information
oakbani committed Oct 3, 2019
1 parent d241a2f commit dc53d39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions optimizely/event/event_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ def _validate_intantiation_props(self, prop, prop_name):
prop_name: Property name.
Returns:
False if property value is None or less than 1 or not a finite number.
False if property value is None or less than or equal to 0 or not a finite number.
False if property name is batch_size and value is a floating point number.
True otherwise.
"""
if (prop_name == 'batch_size' and not isinstance(prop, int)) or prop is None or prop < 1 or \
if (prop_name == 'batch_size' and not isinstance(prop, int)) or prop is None or prop <= 0 or \
not validator.is_finite_number(prop):
self.logger.info('Using default value for {}.'.format(prop_name))
return False
Expand Down Expand Up @@ -159,11 +159,11 @@ def _run(self):
"""
try:
while True:
if self._get_time() > self.flushing_interval_deadline:
if self._get_time() >= self.flushing_interval_deadline:
self._flush_queue()

try:
item = self.event_queue.get(True, 0.05)
item = self.event_queue.get(False)

except queue.Empty:
time.sleep(0.05)
Expand Down

0 comments on commit dc53d39

Please sign in to comment.