MCPcopy Index your code
hub / github.com/NanmiCoder/MediaCrawler / set_ip

Method set_ip

proxy/base_proxy.py:58–66  ·  view source on GitHub ↗

Set IP with expiration time, Redis is responsible for deletion after expiration :param ip_key: :param ip_value_info: :param ex: :return:

(self, ip_key: str, ip_value_info: str, ex: int)

Source from the content-addressed store, hash-verified

56 self.cache_client: AbstractCache = CacheFactory.create_cache(cache_type=config.CACHE_TYPE_REDIS)
57
58 def set_ip(self, ip_key: str, ip_value_info: str, ex: int):
59 """
60 Set IP with expiration time, Redis is responsible for deletion after expiration
61 :param ip_key:
62 :param ip_value_info:
63 :param ex:
64 :return:
65 """
66 self.cache_client.set(key=ip_key, value=ip_value_info, expire_time=ex)
67
68 def load_all_ip(self, proxy_brand_name: str) -> List[IpInfoModel]:
69 """

Callers 3

get_proxyMethod · 0.80
get_proxyMethod · 0.80
get_proxyMethod · 0.80

Calls 1

setMethod · 0.45

Tested by

no test coverage detected