Skip to content

Commit

Permalink
close db only if using queue
Browse files Browse the repository at this point in the history
If the application isn't using the queue backend
we shouldn't be closing the db for them.
  • Loading branch information
Matt George committed Nov 1, 2012
1 parent ca58c34 commit 59c71eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ workers through the manage command, you don't have to mess around with setting v

Changes
=======
0.1.2 - cleaned up the decorators so database connections are closed at the end of a job.
0.1.3 - database connections should only be cleaned up when the queue is being used.
0.1.2 - cleaned up the decorators so database connections are closed at the end of a job.
2 changes: 1 addition & 1 deletion django_pyres/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (0, 1, 2)
VERSION = (0, 1, 3)
__version__ = '.'.join(map(str, VERSION))

3 changes: 2 additions & 1 deletion django_pyres/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
def close_connection_after(func):
def wrapper(*args, **kwargs):
result = func(*args, **kwargs)
db.close_connection()
if settings.PYRES_USE_QUEUE:
db.close_connection()
return result
update_wrapper(wrapper, func)
return wrapper
Expand Down

0 comments on commit 59c71eb

Please sign in to comment.