mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed asyncio random task error messages in Query tool. #6109
This commit is contained in:
parent
15914fe5e3
commit
660a75a582
@ -16,12 +16,11 @@ result.
|
|||||||
import asyncio
|
import asyncio
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
import psycopg
|
import psycopg
|
||||||
|
from flask import g, current_app
|
||||||
from psycopg import Cursor as _cursor, AsyncCursor as _async_cursor
|
from psycopg import Cursor as _cursor, AsyncCursor as _async_cursor
|
||||||
from typing import Any, Sequence
|
from typing import Any, Sequence
|
||||||
from psycopg.rows import dict_row, tuple_row
|
from psycopg.rows import dict_row, tuple_row
|
||||||
from psycopg._encodings import py_codecs as encodings
|
from psycopg._encodings import py_codecs as encodings
|
||||||
|
|
||||||
|
|
||||||
from .encoding import configure_driver_encodings
|
from .encoding import configure_driver_encodings
|
||||||
|
|
||||||
configure_driver_encodings(encodings)
|
configure_driver_encodings(encodings)
|
||||||
@ -278,7 +277,10 @@ class AsyncDictCursor(_async_cursor):
|
|||||||
"""
|
"""
|
||||||
Execute function
|
Execute function
|
||||||
"""
|
"""
|
||||||
return asyncio.run(self._execute(query, params))
|
try:
|
||||||
|
return asyncio.run(self._execute(query, params))
|
||||||
|
except RuntimeError as e:
|
||||||
|
current_app.logger.exception(e)
|
||||||
|
|
||||||
async def _execute(self, query, params=None):
|
async def _execute(self, query, params=None):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user