Skip to content

Commit 614a3d4

Browse files
committed
Merge branch 'mnoman/AddBatchEP' into mnoman/log_event_notification
2 parents 7e20be7 + 498db55 commit 614a3d4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

optimizely/event/event_processor.py

+12
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ def process(self, user_event):
228228
self.logger.debug('Payload not accepted by the queue. Current size: {}'.format(str(self.event_queue.qsize())))
229229

230230
def _add_to_batch(self, user_event):
231+
""" Method to append received user event to current batch.
232+
Args:
233+
user_event: UserEvent Instance.
234+
"""
231235
if self._should_split(user_event):
232236
self._flush_queue()
233237
self._current_batch = list()
@@ -243,6 +247,14 @@ def _add_to_batch(self, user_event):
243247
self._flush_queue()
244248

245249
def _should_split(self, user_event):
250+
""" Method to check if current event batch should split into two.
251+
Args:
252+
user_event: UserEvent Instance.
253+
Return Value:
254+
- True, if revision number and project_id of last event in current batch do not match received event's
255+
revision number and project id respectively.
256+
- False, otherwise.
257+
"""
246258
if len(self._current_batch) == 0:
247259
return False
248260

0 commit comments

Comments
 (0)