Fix #5 ChunkedEncodingError

This commit is contained in:
spla 2022-05-06 13:53:53 +02:00
pare 6ac6a05fbc
commit 739c8bfb74

Veure arxiu

@ -12,6 +12,13 @@ import ray
ray.init(num_cpus = 32) # Specify this system CPUs. ray.init(num_cpus = 32) # Specify this system CPUs.
from ray.exceptions import (
RaySystemError,
RayError,
RayTaskError,
ObjectStoreFullError,
)
apis = ['/api/v1/instance?', apis = ['/api/v1/instance?',
'/nodeinfo/2.0?', '/nodeinfo/2.0?',
'/nodeinfo/2.0.json?', '/nodeinfo/2.0.json?',
@ -82,6 +89,8 @@ def getsoft(server):
return return
if server.find(":") != -1: if server.find(":") != -1:
return return
if server == 'z.fedipen.xyz':
return
soft = '' soft = ''
@ -199,6 +208,16 @@ def getsoft(server):
pass pass
except requests.exceptions.ChunkedEncodingError as chunk_err:
print(f'ChunkedEncodingError! {server}')
pass
except ray.exceptions.RaySystemError as ray_sys_error:
print(ray_sys_error)
pass
else: else:
if is_nodeinfo: if is_nodeinfo:
@ -427,9 +446,15 @@ if __name__ == '__main__':
ray_start = time.time() ray_start = time.time()
results = ray.get([getsoft.remote(server) for server in world_servers]) try:
print(f"duration = {time.time() - ray_start}.\nprocessed servers: {len(results)}") results = ray.get([getsoft.remote(server) for server in world_servers])
print(f"duration = {time.time() - ray_start}.\nprocessed servers: {len(results)}")
except:
pass
finish = datetime.now() finish = datetime.now()