Skip to content

Commit 254635c

Browse files
committed
Fix: Replaced CloudFlare DNS service by AdGuard DNS service to prevent French people from having issues.
1 parent 17fe6c7 commit 254635c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

examples/example_fastapi/main.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ async def environ() -> dict[str, str]:
126126

127127
async def get_aleph_messages(api_host: str, message_filter: MessageFilter):
128128
async with AlephHttpClient(api_server=api_host) as client:
129-
data = await client.get_messages(
130-
message_filter=message_filter
131-
)
129+
data = await client.get_messages(message_filter=message_filter)
132130
return data.dict()
133131

134132

@@ -138,7 +136,9 @@ async def read_aleph_messages() -> dict[str, MessagesResponse]:
138136
message_filter = MessageFilter(hashes=["f246f873c3e0f637a15c566e7a465d2ecbb83eaa024d54ccb8fb566b549a929e"])
139137

140138
# Create a list of tasks to check the URLs in parallel
141-
tasks: set[asyncio.Task] = {asyncio.create_task(get_aleph_messages(host, message_filter)) for host in ALEPH_API_HOSTS}
139+
tasks: set[asyncio.Task] = {
140+
asyncio.create_task(get_aleph_messages(host, message_filter)) for host in ALEPH_API_HOSTS
141+
}
142142

143143
failures = []
144144

@@ -204,7 +204,7 @@ async def connect_ipv4():
204204
"""
205205
ipv4_hosts: list[str] = [
206206
"https://9.9.9.9", # Quad9 VPN service
207-
"https://1.1.1.1", # CloudFlare DNS service
207+
"https://94.140.14.14", # AdGuard DNS service
208208
"https://208.67.222.222", # OpenDNS service
209209
]
210210
timeout_seconds = 5
@@ -384,7 +384,9 @@ async def post_with_remote_account():
384384
account = await RemoteAccount.from_crypto_host(host="http://localhost", unix_socket="/tmp/socat-socket")
385385

386386
# Create a list of tasks to check the URLs in parallel
387-
tasks: set[asyncio.Task] = {asyncio.create_task(send_post_aleph_message(host, account)) for host in ALEPH_API_HOSTS}
387+
tasks: set[asyncio.Task] = {
388+
asyncio.create_task(send_post_aleph_message(host, account)) for host in ALEPH_API_HOSTS
389+
}
388390

389391
# While no tasks have completed, keep waiting for the next one to finish
390392
while tasks:

0 commit comments

Comments
 (0)