Skip to content

Commit

Permalink
#186450397 #186127421 Refactor: Event queue size config option defaul…
Browse files Browse the repository at this point in the history
…t to 1M (#81)

Refactor: Event queue size config option default to 1M
Refactor: Bump moesifpythonrequest to version 0.3.2
Refactor: Update README.md
Bump version to 2.3.5
  • Loading branch information
keyur9 authored Nov 17, 2023
1 parent 3f78858 commit 3e9e1ec
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ to add custom metadata that will be associated with the event. The metadata must
(optional) __int__, default 25, Maximum batch size when sending to Moesif.

#### __`EVENT_QUEUE_SIZE`__
(optional) __int__, default 10000, Maximum number of events to hold in queue before sending to Moesif. In case of network issues when not able to connect/send event to Moesif, skips adding new to event to queue to prevent memory overflow.
(optional) __int__, default 1000000, Maximum number of events to hold in queue before sending to Moesif. In case of network issues when not able to connect/send event to Moesif, skips adding new to event to queue to prevent memory overflow.

#### __`AUTHORIZATION_HEADER_NAME`__
(optional) _string_, A request header field name used to identify the User in Moesif. Default value is `authorization`. Also, supports a comma separated string. We will check headers in order like `"X-Api-Key,Authorization"`.
Expand Down
2 changes: 1 addition & 1 deletion moesifdjango/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self, get_response):
self.rules_etag = None
self.last_updated_time = datetime.utcnow()
self._reset_scheduler()
self.event_queue_size = self.middleware_settings.get('EVENT_QUEUE_SIZE', 10000)
self.event_queue_size = self.middleware_settings.get('EVENT_QUEUE_SIZE', 1000000)
self.mo_events_queue = queue.Queue(maxsize=self.event_queue_size)
self.event_batch_size = self.middleware_settings.get('BATCH_SIZE', 25)
try:
Expand Down
2 changes: 1 addition & 1 deletion moesifdjango/middleware_pre19.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self):
self.config_etag = None
self.last_updated_time = datetime.utcnow()
self._reset_scheduler()
self.event_queue_size = self.middleware_settings.get('EVENT_QUEUE_SIZE', 10000)
self.event_queue_size = self.middleware_settings.get('EVENT_QUEUE_SIZE', 1000000)
self.mo_events_queue = queue.Queue(maxsize=self.event_queue_size)
self.event_batch_size = self.middleware_settings.get('BATCH_SIZE', 25)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ nose==1.3.7
isodatetimehandler==1.0.2
moesifapi==1.4.1
celery>=3.1.25
moesifpythonrequest==0.3.0
moesifpythonrequest==0.3.2
apscheduler==3.6.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='2.3.4',
version='2.3.5',

description='Moesif Middleware for Python Django',
long_description=long_description,
Expand Down

0 comments on commit 3e9e1ec

Please sign in to comment.