File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -951,6 +951,7 @@ async def _flush_and_close(
951
951
_flush_and_close (timeout , callback )
952
952
)
953
953
except RuntimeError :
954
+ self ._close_components ()
954
955
logger .warning ("Event loop not running, aborting close." )
955
956
return None
956
957
# Enforce flush before shutdown
@@ -975,12 +976,6 @@ def flush( # type: ignore[override]
975
976
if self .transport is not None :
976
977
if timeout is None :
977
978
timeout = self .options ["shutdown_timeout" ]
978
- assert timeout is not None # shutdown_timeout should never be None
979
-
980
- self .session_flusher .flush ()
981
-
982
- if self .log_batcher is not None :
983
- self .log_batcher .flush ()
984
979
985
980
if isinstance (self .transport , AsyncHttpTransport ):
986
981
try :
@@ -991,6 +986,11 @@ def flush( # type: ignore[override]
991
986
logger .warning ("Event loop not running, aborting flush." )
992
987
return None
993
988
else :
989
+ self .session_flusher .flush ()
990
+
991
+ if self .log_batcher is not None :
992
+ self .log_batcher .flush ()
993
+
994
994
self .transport .flush (timeout = timeout , callback = callback )
995
995
return None
996
996
You can’t perform that action at this time.
0 commit comments