Skip to content

Commit bda0ede

Browse files
authored
Merge pull request #171 from salute-developers/fix/PNLP-8011_fix_ignite_reconnection
PNLP-8011: fix ignite reconnect
2 parents 3c92e0e + 1a351e9 commit bda0ede

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/db_adapter/ignite_adapter.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# coding: utf-8
22
import random
33
from concurrent.futures._base import CancelledError
4+
from typing import Optional
45

56
import pyignite
67
from pyignite import AioClient
78
from pyignite.aio_cache import AioCache
8-
from pyignite.exceptions import ReconnectError, SocketError
9+
from pyignite.exceptions import ReconnectError, SocketError, CacheError
910

1011
import core.logging.logger_constants as log_const
1112
from core.db_adapter import error
@@ -15,7 +16,7 @@
1516

1617

1718
class IgniteAdapter(AsyncDBAdapter):
18-
_client: AioClient
19+
_client: Optional[AioClient]
1920
_cache = AioCache
2021

2122
def __init__(self, config):
@@ -80,9 +81,9 @@ async def get_cache(self):
8081
@property
8182
def _handled_exception(self):
8283
# TypeError is raised during reconnection if all nodes are exhausted
83-
return OSError, SocketError, ReconnectError, CancelledError
84+
return OSError, SocketError, ReconnectError, CancelledError, CacheError
8485

85-
async def _on_prepare(self):
86+
def _on_prepare(self):
8687
self._client = None
8788

8889
async def _get_counter_name(self):

0 commit comments

Comments
 (0)