databases icon indicating copy to clipboard operation
databases copied to clipboard

Bug : await self._connection.acquire() Failed

Open CL545740896 opened this issue 5 years ago • 0 comments

When the connection is abnormal, due to local network problems, etc., it will not work when the network is restored.

#Fix self._connection.acquire() Failed FilePath : core.py - > Line : 213

  async def __aenter__(self) -> "Connection":
        async with self._connection_lock:
            self._connection_counter += 1
            if self._connection_counter == 1:
                try:
                   # add a catch to acquire connection
                    await self._connection.acquire()    
                except Exception as e:
                    #   reset the _connection_counter  = 1
                    self._connection_counter = 1
        return self

CL545740896 avatar Sep 07 '20 13:09 CL545740896