Save proxies event after interruption

Fixes #316
This commit is contained in:
monosans
2024-09-18 18:23:01 +03:00
parent dac5280b4e
commit aa57dbfafc
5 changed files with 72 additions and 54 deletions
+6 -2
View File
@@ -39,8 +39,12 @@ class Proxy:
port: int
username: str | None
password: str | None
timeout: float = attrs.field(init=False, eq=False)
exit_ip: str | None = attrs.field(init=False, eq=False)
timeout: float | None = attrs.field(default=None, init=False, eq=False)
exit_ip: str | None = attrs.field(default=None, init=False, eq=False)
@property
def is_checked(self) -> bool:
return self.timeout is not None
async def check(self, *, settings: Settings) -> None:
async with settings.semaphore: