This commit is contained in:
PawelDopierala 2024-11-26 21:55:52 +01:00
parent 5a46349248
commit d6fa089f1e
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ async def send_request(client, server_ip, rangee, sigma):
# Główna funkcja do wysyłania zapytań do wszystkich serwerów równocześnie
async def main(a_start, b_end, sigma):
num_chunks = len(ip_list)
chunk_size = (b_end - a_start + 1) // num_chunks
chunk_size = (b_end - a_start + num_chunks) // num_chunks
ranges = [(a_start + i * chunk_size, min(a_start + (i + 1) * chunk_size - 1, b_end))
for i in range(num_chunks)]
async with httpx.AsyncClient() as client:
@ -32,7 +32,7 @@ async def main(a_start, b_end, sigma):
# Uruchomienie głównej funkcji
if __name__ == "__main__":
sigma = 230531719
sigma = 1220131495
a = 1
b = 10000
asyncio.run(main(a, b, sigma))

View File

@ -29,7 +29,7 @@ async def compute(data: ComputeInput):
num_chunks = 16
chunk_size = (b_end - a_start + 1) // num_chunks
chunk_size = (b_end - a_start + num_chunks) // num_chunks
ranges = [(a_start + i * chunk_size, min(a_start + (i + 1) * chunk_size - 1, b_end))
for i in range(num_chunks)]