Skip to content

Commit

Permalink
Merge pull request #12 from wildfoundry/auto-close
Browse files Browse the repository at this point in the history
Auto close
  • Loading branch information
willmcgugan authored May 23, 2017
2 parents e742b50 + b4bda15 commit 8cb866f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion m2mclient/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import unicode_literals

VERSION = "0.1.7"
VERSION = "0.1.8"
25 changes: 14 additions & 11 deletions m2mclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,21 @@ def client(self):
def run(self):
"""Main thread loop."""
try:
for event in self.ws:
if event.name == 'rejected':
self.error = event.reason
elif event.name == 'disconnected':
if not event.graceful:
with self.ws:
for event in self.ws:
if event.name == 'rejected':
self.error = event.reason
elif event.name == 'ready':
self.running = True
self.on_startup()
self.ready_event.set()
elif event.name == 'binary':
self.on_binary(event.data)
elif event.name == 'disconnected':
if not event.graceful:
self.error = event.reason
elif event.name == 'ready':
self.running = True
self.on_startup()
self.ready_event.set()
elif event.name == 'binary':
self.on_binary(event.data)
except Exception:
log.exception('error in m2m thread')
finally:
self.running = False
self.ready_event.set()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
exclude_package_data={'': ['_*', 'docs/*']},
classifiers=classifiers,
install_requires=[
'lomond==0.1.6',
'lomond==0.1.7a0',
'wsaccel==0.6.2'
]
)

0 comments on commit 8cb866f

Please sign in to comment.