diff --git a/zaqar/notification/notifier.py b/zaqar/notification/notifier.py index ad0d633ba..4a7d077d0 100644 --- a/zaqar/notification/notifier.py +++ b/zaqar/notification/notifier.py @@ -29,11 +29,8 @@ class NotifierDriver(object): def __init__(self, *args, **kwargs): self.subscription_controller = kwargs.get('subscription_controller') - try: - self.executor = futurist.GreenThreadPoolExecutor() - except RuntimeError: - # TODO(flwang): Make the max_workers configurable - self.executor = futurist.ThreadPoolExecutor(max_workers=10) + # TODO(flwang): Make the max_workers configurable + self.executor = futurist.ThreadPoolExecutor(max_workers=10) def post(self, queue_name, messages, client_uuid, project=None): """Send messages to the subscribers.""" diff --git a/zaqar/tests/unit/notification/test_notifier.py b/zaqar/tests/unit/notification/test_notifier.py index 82e512689..fec31a69f 100644 --- a/zaqar/tests/unit/notification/test_notifier.py +++ b/zaqar/tests/unit/notification/test_notifier.py @@ -51,6 +51,7 @@ class NotifierTest(testing.TestBase): with mock.patch('requests.post') as mock_post: self.driver.post('fake_queue', self.messages, self.client_id, self.project) + self.driver.executor.shutdown() mock_post.assert_has_calls([ mock.call(self.subscription[0]['subscriber'], data=json.dumps(self.messages[0]),