mirror of
https://github.com/zulip/zulip.git
synced 2025-10-28 10:33:54 +00:00
Revert "db: Force use of TimeTrackingCursor to work around Django 4.2 bug."
This reverts commit f1925487e8.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
d0481be3e5
commit
e88b2caeef
@@ -1,17 +1,5 @@
|
||||
import time
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
Iterable,
|
||||
List,
|
||||
Mapping,
|
||||
Optional,
|
||||
Sequence,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing import Any, Callable, Dict, Iterable, List, Mapping, Sequence, TypeVar, Union
|
||||
|
||||
from psycopg2.extensions import connection, cursor
|
||||
from psycopg2.sql import Composable
|
||||
@@ -60,41 +48,6 @@ class TimeTrackingConnection(connection):
|
||||
self.queries: List[Dict[str, str]] = []
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@overload
|
||||
def cursor(
|
||||
self,
|
||||
name: Union[str, bytes, None] = ...,
|
||||
*,
|
||||
withhold: bool = ...,
|
||||
scrollable: Optional[bool] = ...,
|
||||
) -> TimeTrackingCursor:
|
||||
...
|
||||
|
||||
@overload
|
||||
def cursor(
|
||||
self,
|
||||
name: Union[str, bytes, None] = ...,
|
||||
*,
|
||||
cursor_factory: Callable[..., CursorT] = ...,
|
||||
withhold: bool = ...,
|
||||
scrollable: Optional[bool] = ...,
|
||||
) -> CursorT:
|
||||
...
|
||||
|
||||
@overload
|
||||
def cursor(
|
||||
self,
|
||||
name: Union[str, bytes, None],
|
||||
cursor_factory: Callable[..., CursorT] = ...,
|
||||
withhold: bool = ...,
|
||||
scrollable: Optional[bool] = ...,
|
||||
) -> CursorT:
|
||||
...
|
||||
|
||||
def cursor(self, *args: Any, **kwargs: Any) -> cursor:
|
||||
kwargs["cursor_factory"] = TimeTrackingCursor
|
||||
return super().cursor(*args, **kwargs)
|
||||
|
||||
|
||||
def reset_queries() -> None:
|
||||
from django.db import connections
|
||||
|
||||
Reference in New Issue
Block a user