Skip to content
Snippets Groups Projects
Commit 3ef7d4b4 authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

Merge branch '30_fix_wait_method' into 'master'

Fix wait method

Closes #30

See merge request !67
parents 74ad0985 f0d4a464
Branches
Tags
1 merge request!67Fix wait method
Pipeline #36728 failed
...@@ -223,7 +223,12 @@ class DBExecutor(object): ...@@ -223,7 +223,12 @@ class DBExecutor(object):
def wait(self): def wait(self):
"""Wait for the message handle to finish""" """Wait for the message handle to finish"""
self.message_handler.join() try:
self.message_handler.join()
except RuntimeError:
# tried to join the handler before it has started.
pass
self.message_handler = None self.message_handler = None
def __str__(self): def __str__(self):
......
...@@ -291,7 +291,12 @@ class LoopExecutor(object): ...@@ -291,7 +291,12 @@ class LoopExecutor(object):
def wait(self): def wait(self):
"""Wait for the message handle to finish""" """Wait for the message handle to finish"""
self.message_handler.join() try:
self.message_handler.join()
except RuntimeError:
# tried to join the handler before it has started.
pass
self.message_handler = None self.message_handler = None
def close(self): def close(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment