Check if current proxy has expired Args: buffer_seconds: Buffer time (seconds), how many seconds ahead to consider expired Returns: bool: True means expired or no current proxy, False means still valid
(self, buffer_seconds: int = 30)
| 116 | return proxy |
| 117 | |
| 118 | def is_current_proxy_expired(self, buffer_seconds: int = 30) -> bool: |
| 119 | """ |
| 120 | Check if current proxy has expired |
| 121 | Args: |
| 122 | buffer_seconds: Buffer time (seconds), how many seconds ahead to consider expired |
| 123 | Returns: |
| 124 | bool: True means expired or no current proxy, False means still valid |
| 125 | """ |
| 126 | if self.current_proxy is None: |
| 127 | return True |
| 128 | return self.current_proxy.is_expired(buffer_seconds) |
| 129 | |
| 130 | async def get_or_refresh_proxy(self, buffer_seconds: int = 30) -> IpInfoModel: |
| 131 | """ |