errbot icon indicating copy to clipboard operation
errbot copied to clipboard

IRC: Reconnection interval produces warning

Open pintman opened this issue 8 years ago • 0 comments

In order to let us help you better, please fill out the following fields as best you can:

I am...

  • [x] Reporting a bug
  • [ ] Suggesting a new feature
  • [ ] Requesting help with running my bot
  • [ ] Requesting help writing plugins
  • [ ] Here about something else

I am running...

  • Errbot version: 5.1.2
  • OS version: LinuxMint 18.1
  • Python version: 3.5.2
  • Using a virtual environment: yes

Issue description

When setting the IRC_RECONNECT_ON_DISCONNECT option there is a warning from the irc lib referring to use a reconnect strategy instead of an interval.

https://github.com/jaraco/irc/blob/master/irc/bot.py#L155

Values bigger than 300 produce an error in this lib.

Steps to reproduce

Use a bigger value for reconnection time to produce an error during start

IRC_RECONNECT_ON_DISCONNECT=500

Error after startup

Exception: Error loading plugin IRC:
Error:
<class 'AssertionError'>:
  File "/home/.../bot/venv/lib/python3.5/site-packages/yapsy/PluginManager.py", line 512, in loadPlugins
    plugin_info.plugin_object = self.instanciateElement(element)
  File "/home/.../bot/venv/lib/python3.5/site-packages/errbot/specific_plugin_manager.py", line 59, in instanciateElement
    return element(self._config)
  File "/home/.../bot/venv/lib/python3.5/site-packages/errbot/backends/irc.py", line 668, in __init__
    reconnect_on_disconnect=reconnect_on_disconnect,
  File "/home/.../bot/venv/lib/python3.5/site-packages/errbot/backends/irc.py", line 351, in __init__
    super().__init__([(server, port, password)], nickname, username, reconnection_interval=reconnect_on_disconnect)
  File "/home/.../bot/venv/lib/python3.5/site-packages/irc/bot.py", line 158, in __init__
    self.recon = ExponentialBackoff(min_interval=reconnection_interval)
  File "/home/.../bot/venv/lib/python3.5/site-packages/irc/bot.py", line 72, in __init__
    assert 0 <= self.min_interval <= self.max_interval

pintman avatar Sep 03 '17 07:09 pintman