Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Use submanagers in appmux router instead of creating a new Redis clie…
Browse files Browse the repository at this point in the history
…nt for every message.
  • Loading branch information
jerith committed Jul 10, 2014
1 parent 33d2606 commit 033ca23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions go/routers/app_multiplexer/tests/test_vumi_app.py
Expand Up @@ -3,6 +3,7 @@
from twisted.internet.defer import inlineCallbacks

from vumi.tests.helpers import VumiTestCase

from go.routers.app_multiplexer.vumi_app import ApplicationMultiplexer
from go.routers.tests.helpers import RouterWorkerHelper

Expand Down
8 changes: 3 additions & 5 deletions go/routers/app_multiplexer/vumi_app.py
Expand Up @@ -85,11 +85,9 @@ def setup_router(self):
return d

def session_manager(self, config):
return SessionManager.from_redis_config(
config.redis_manager,
key_prefix=':'.join((self.worker_name, config.router.key)),
max_session_length=config.session_expiry
)
key_prefix = ':'.join((self.worker_name, config.router.key))
redis = self.redis.sub_manager(key_prefix)
return SessionManager(redis, max_session_length=config.session_expiry)

def target_endpoints(self, config):
"""
Expand Down

0 comments on commit 033ca23

Please sign in to comment.