Add settings for pooling, keep_alive

This commit is contained in:
zandercymatics 2023-10-12 10:16:22 -06:00
parent a02d27aaec
commit 3a28a3a362
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 28 additions and 9 deletions

View file

@ -17,7 +17,6 @@ from django.conf import settings
from .cert import Cert, Key
from .errors import LoginError, RegistryError
from .socket import Socket
logger = logging.getLogger(__name__)
@ -64,11 +63,11 @@ class EPPLibWrapper:
)
options = {
# Pool size
"size": 10,
"size": settings.EPP_CONNECTION_POOL_SIZE,
# Which errors the pool should look out for
"exc_classes": (LoginError, RegistryError,),
# Should we ping the connection on occasion to keep it alive?
"keepalive": None,
# Occasionally pings the registry to keep the connection alive
"keepalive": settings.POOL_KEEP_ALIVE,
}
self._pool = EppConnectionPool(client=self._client, login=self._login, options=options)