force register_server requests to go throut IPv4
This commit is contained in:
parent
6150cf48cb
commit
2d1c15c7bf
|
@ -3,6 +3,7 @@ from lib import logging as logging_lib
|
||||||
from lib import get_specs
|
from lib import get_specs
|
||||||
from lib import utils
|
from lib import utils
|
||||||
import threading
|
import threading
|
||||||
|
import socket
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
|
@ -47,7 +48,9 @@ async def register_server(data):
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
}
|
}
|
||||||
|
|
||||||
async with aiohttp.ClientSession() as session:
|
connector = aiohttp.TCPConnector(family=socket.AF_INET)
|
||||||
|
|
||||||
|
async with aiohttp.ClientSession(connector=connector) as session:
|
||||||
try:
|
try:
|
||||||
async with session.post(url, data=json_data, headers=headers, timeout=15) as response:
|
async with session.post(url, data=json_data, headers=headers, timeout=15) as response:
|
||||||
if response.status == 200:
|
if response.status == 200:
|
||||||
|
|
Loading…
Reference in New Issue