One Hat Cyber Team
Your IP :
216.73.216.208
Server IP :
203.175.9.166
Server :
Linux tanggamus.iixcp.rumahweb.net 5.14.0-427.28.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 2 03:44:10 EDT 2024 x86_64
Server Software :
LiteSpeed
PHP Version :
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3.9
/
site-packages
/
redis
/
asyncio
/
View File Name :
utils.py
from typing import TYPE_CHECKING if TYPE_CHECKING: from redis.asyncio.client import Pipeline, Redis def from_url(url, **kwargs): """ Returns an active Redis client generated from the given database URL. Will attempt to extract the database id from the path url fragment, if none is provided. """ from redis.asyncio.client import Redis return Redis.from_url(url, **kwargs) class pipeline: def __init__(self, redis_obj: "Redis"): self.p: "Pipeline" = redis_obj.pipeline() async def __aenter__(self) -> "Pipeline": return self.p async def __aexit__(self, exc_type, exc_value, traceback): await self.p.execute() del self.p