Skip to content

Commit

Permalink
Merge pull request #5376 from mstilkerich/fix_dockerapi_cpuload
Browse files Browse the repository at this point in the history
Fix CPU load of dockerapi container
  • Loading branch information
FreddleSpl0it authored Aug 28, 2023
2 parents 30e241b + 930473a commit 9ba5c13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data/Dockerfiles/dockerapi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ async def handle_pubsub_messages(channel: aioredis.client.PubSub):

while True:
try:
async with async_timeout.timeout(1):
message = await channel.get_message(ignore_subscribe_messages=True)
async with async_timeout.timeout(60):
message = await channel.get_message(ignore_subscribe_messages=True, timeout=30)
if message is not None:
# Parse message
data_json = json.loads(message['data'].decode('utf-8'))
Expand Down Expand Up @@ -244,7 +244,7 @@ async def handle_pubsub_messages(channel: aioredis.client.PubSub):
else:
dockerapi.logger.error("Unknwon PubSub recieved - %s" % json.dumps(data_json))

await asyncio.sleep(0.01)
await asyncio.sleep(0.0)
except asyncio.TimeoutError:
pass

Expand Down

0 comments on commit 9ba5c13

Please sign in to comment.