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

Commit

Permalink
Traversal optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Navarro Bosch committed Mar 8, 2017
1 parent 0b65bba commit 2a987ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plone.server/plone/server/traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ async def traverse(request, parent, path):
request.conn = context.conn
else:
# Create a new conection
if len(context._db.pool.all) > context._db.pool._size:
if len(context._db.pool.all) + 5 > context._db.pool._size:
context._db.pool._reduce_size(strictly_less=True)
await asyncio.sleep(2)
context._db.pool._reduce_size(strictly_less=True)
print('BEFORE AVAILABLE: %d' % len(context._db.pool.available))
print('ALL CONNECTIONS: %d' % len(context._db.pool.all))
request.conn = context.open()
Expand Down

0 comments on commit 2a987ac

Please sign in to comment.