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)
| 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 | """ |