MCPcopy
hub / github.com/redis/redis-py / teardown

Method teardown

benchmarks/otel_benchmark.py:503–526  ·  view source on GitHub ↗

Clean up all Redis resources.

(self)

Source from the content-addressed store, hash-verified

501 pass
502
503 async def teardown(self) -> None:
504 """Clean up all Redis resources."""
505 if self.pubsub:
506 try:
507 await self.pubsub.unsubscribe()
508 await self.pubsub.aclose()
509 except Exception:
510 pass
511
512 if self.pubsub_publisher:
513 try:
514 await self.pubsub_publisher.aclose()
515 except Exception:
516 pass
517
518 if self.client:
519 try:
520 await self.client.delete(self.stream_name)
521 except Exception:
522 pass
523 try:
524 await self.client.aclose()
525 except Exception:
526 pass
527
528 async def _run_operation(self) -> float:
529 """

Callers 2

run_iteration_asyncFunction · 0.95

Calls 3

unsubscribeMethod · 0.45
acloseMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected