Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
Show some debug information about connections
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Navarro Bosch committed Mar 7, 2017
1 parent 1d4c423 commit 8767602
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/plone.server/plone/server/traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ async def traverse(request, parent, path):
else:
# Create a new conection
context._db.pool._reduce_size(strictly_less=True)
print('BEFORE AVAILABLE: %d' % len(context._db.pool.available))
request.conn = context.open()
# Check the transaction
request._db_write_enabled = False
Expand Down Expand Up @@ -246,6 +247,8 @@ async def handler(self, request):
# If we want to close the connection after the request
if SHARED_CONNECTION is False and hasattr(request, 'conn'):
request.conn.close()
print('AFTER AVAILABLE: %d' % len(request.conn._db.pool.available))


# Make sure its a Response object to send to renderer
if not isinstance(view_result, Response):
Expand Down

0 comments on commit 8767602

Please sign in to comment.