Skip to content
1,247 changes: 1,239 additions & 8 deletions packages/google-cloud-storage/google/cloud/storage/_opentelemetry_metrics.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from __future__ import annotations

import asyncio
import inspect
import logging
from typing import Awaitable, Callable, Dict, Optional, Set

Expand Down Expand Up @@ -211,6 +212,9 @@ async def reopen_stream(
self._ensure_recv_loop()

async def close(self) -> None:
mark_clean = getattr(self._stream, "_mark_closing_cleanly", None)
if callable(mark_clean) and not inspect.iscoroutinefunction(mark_clean):
mark_clean()
self._stop_recv_loop()
if self._recv_task:
try:
Expand Down

Large diffs are not rendered by default.

Loading
Loading