Imports cleanup
authorThierry Florac <thierry.florac@onf.fr>
Thu, 20 Jun 2019 12:50:23 +0200
changeset 20 03c3572a16ad
parent 19 803130da71e5
child 21 5f2f72c00120
Imports cleanup
src/pyams_notify_ws/notify.py
--- a/src/pyams_notify_ws/notify.py	Sun Mar 11 11:23:33 2018 +0100
+++ b/src/pyams_notify_ws/notify.py	Thu Jun 20 12:50:23 2019 +0200
@@ -12,25 +12,21 @@
 
 __docformat__ = 'restructuredtext'
 
-
-# import standard library
 import asyncio
 import collections
 import json
 import pickle
 
-# import interfaces
-from pyams_cache.interfaces import IAioCacheHandler
-
-# import packages
 from aiopyramid.websocket.config.gunicorn import WebsocketMapper
 from aiopyramid.websocket.view import WebsocketConnectionView
-from pyams_cache.cache import get_cache_handler
-from pyams_notify_ws.subscribe import users, users_lock
 from pyramid.view import view_config
 
+from pyams_cache.cache import get_cache_handler
+from pyams_cache.interfaces import IAioCacheHandler
+from pyams_notify_ws.subscribe import users, users_lock
 
-queue = collections.deque(maxlen=50)
+
+queue = collections.deque(maxlen=100)
 queue_key = b'PyAMS:notify:messages_queue'
 queue_lock = asyncio.Lock()
 
@@ -71,7 +67,7 @@
                             continue
                         if subscription.filter_target(target):
                             await connection.send(json_message)
-                # store message in memcached_queue
+                # store message in cached queue
                 if cache_handler is not None:
                     async with queue_lock:
                         mem_queue = await cache_handler.get(queue_key)