FM-17 / poglink

A bot that integrates the ARK Web API with Discord.
MIT License
12 stars 4 forks source link

fix: replaced time.sleep with asyncio.sleep #47

Closed FM-17 closed 2 years ago

FM-17 commented 2 years ago

Currently doesn't function with time.sleep(). Switched to asyncio.sleep() for the time being, but will require further review

Relevant references

https://discordpy.readthedocs.io/en/stable/faq.html#what-does-blocking-mean https://stackoverflow.com/questions/65881761/discord-gateway-warning-shard-id-none-heartbeat-blocked-for-more-than-10-second

Log output prior to switch

2022-01-06 20:34:33,071:DEBUG:discord.gateway: Keeping shard ID None websocket alive with sequence 5.
2022-01-06 20:34:43,076:WARNING:discord.gateway: Shard ID None heartbeat blocked for more than 10 seconds.
Loop thread traceback (most recent call last):
  File "/usr/local/bin/poglink", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/poglink/main.py", line 50, in cli
    run(**config_dict)
  File "/usr/local/lib/python3.7/site-packages/poglink/main.py", line 87, in run
    client.run(client.config.token)
  File "/usr/local/lib/python3.7/site-packages/discord/client.py", line 713, in run
    loop.run_forever()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 541, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1786, in _run_once
    handle._run()
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.7/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/poglink/cogs/rates.py", line 182, in on_ready
    time.sleep(self.polling_delay)
github-actions[bot] commented 2 years ago

:tada: This PR is included in version 0.6.9 :tada:

The release is available on:

Your semantic-release bot :package::rocket: