Skip to content

Commit

Permalink
relase 0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
heynemann committed Jul 2, 2013
1 parent d44dfab commit 7f79a53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

__version__ = '0.1.5'
__version__ = '0.1.6'
4 changes: 4 additions & 0 deletions cow/plugins/motor_plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import logging

import motor

from cow.plugins import BasePlugin
Expand All @@ -11,9 +13,11 @@ class MotorPlugin(BasePlugin):
def after_start(cls, server):
host = server.application.config.get('MONGOHOST')
port = server.application.config.get('MONGOPORT')
logging.info("Connecting to mongodb at %s:%d" % (host, port))
server.mongo = motor.MotorClient(host, port).open_sync()

@classmethod
def before_end(cls, server):
if hasattr(server, 'mongo'):
logging.info("Disconnecting from mongodb...")
server.mongo.disconnect()

0 comments on commit 7f79a53

Please sign in to comment.