Fixed asyncio random task error messages in Query tool. #6109

pull/6121/head
Khushboo Vashi 2023-04-10 16:45:05 +05:30 committed by GitHub
parent 15914fe5e3
commit 660a75a582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -16,12 +16,11 @@ result.
import asyncio
from collections import OrderedDict
import psycopg
from flask import g, current_app
from psycopg import Cursor as _cursor, AsyncCursor as _async_cursor
from typing import Any, Sequence
from psycopg.rows import dict_row, tuple_row
from psycopg._encodings import py_codecs as encodings
from .encoding import configure_driver_encodings
configure_driver_encodings(encodings)
@ -278,7 +277,10 @@ class AsyncDictCursor(_async_cursor):
"""
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):
"""