Skip to content
This repository has been archived by the owner on Oct 21, 2019. It is now read-only.

update disconnect method for opsdroid 0.13.0 #37

Closed
colonelkrud opened this issue Nov 5, 2018 · 4 comments
Closed

update disconnect method for opsdroid 0.13.0 #37

colonelkrud opened this issue Nov 5, 2018 · 4 comments

Comments

@colonelkrud
Copy link
Contributor

Latest opsdroid gives the following exception when receiving a stop signal:

/home/opsdroid/.local/share/opsdroid/opsdroid-modules/connector/matrix/connector.py:201: RuntimeWarning: coroutine 'ClientSession.close' was never awaited
  self.session.close()
INFO opsdroid.core: Stopped connector ConnectorMatrix
INFO opsdroid.core: Stopping database ...
ERROR opsdroid.core: Caught exception
ERROR opsdroid.core: {'message': 'Task exception was never retrieved', 'exception': TypeError('disconnect() takes 1 positional argument but 2 were given',), 'future': <Task finished coro=<OpsDroid.handle_signal() done, defined at /usr/local/lib/python3.6/dist-packages/opsdroid/core.py:120> exception=TypeError('disconnect() takes 1 positional argument but 2 were given',)>}
@jacobtomlinson
Copy link
Member

jacobtomlinson commented Nov 5, 2018

After thinking about this I'm not sure the Connector API is quite right. There is no compelling reason why an opsdroid pointer should have to be passed on disconnect as the connector should already have a pointer to it stored as an attribute from when it was set up.

See opsdroid/opsdroid#725 for more information on my requested change.

Once this is implemented this issue will no longer be necessary.

@jacobtomlinson
Copy link
Member

As the change will not be in until the next release you may wish to make the change but ensure it is an optional kwarg so that when the API changes again it will not break. You could then remove this when matrix is merged as a core connector.

@Cadair
Copy link
Contributor

Cadair commented Nov 5, 2018

I fixed this in #36

@Cadair
Copy link
Contributor

Cadair commented Nov 5, 2018

This can be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants