Skip to content

Commit

Permalink
Merge pull request #171 from salute-developers/fix/PNLP-8011_fix_igni…
Browse files Browse the repository at this point in the history
…te_reconnection

PNLP-8011: fix ignite reconnect
  • Loading branch information
SyrexMinus authored Nov 21, 2023
2 parents 3c92e0e + 1a351e9 commit bda0ede
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/db_adapter/ignite_adapter.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# coding: utf-8
import random
from concurrent.futures._base import CancelledError
from typing import Optional

import pyignite
from pyignite import AioClient
from pyignite.aio_cache import AioCache
from pyignite.exceptions import ReconnectError, SocketError
from pyignite.exceptions import ReconnectError, SocketError, CacheError

import core.logging.logger_constants as log_const
from core.db_adapter import error
Expand All @@ -15,7 +16,7 @@


class IgniteAdapter(AsyncDBAdapter):
_client: AioClient
_client: Optional[AioClient]
_cache = AioCache

def __init__(self, config):
Expand Down Expand Up @@ -80,9 +81,9 @@ async def get_cache(self):
@property
def _handled_exception(self):
# TypeError is raised during reconnection if all nodes are exhausted
return OSError, SocketError, ReconnectError, CancelledError
return OSError, SocketError, ReconnectError, CancelledError, CacheError

async def _on_prepare(self):
def _on_prepare(self):
self._client = None

async def _get_counter_name(self):
Expand Down

0 comments on commit bda0ede

Please sign in to comment.