Commit 61e8a9ce authored by Jérome Perrin's avatar Jérome Perrin

TimerServer: use task_dispatcher.add_task instead of high level add_task

create_server returns either a BaseWSGIServer or a MultiSocketServer,
but add_task only exists in BaseWSGIServer - and the implementation is
simply [1]:

    def add_task(self, task):
        self.task_dispatcher.add_task(task)

by using self.task_dispatcher.add_task directly, we are compatible with
both cases.

This is relevant when running timerserver with runUnitTest, where we
create multiple sockets, one for http and one for web-dav.

1: https://github.com/Pylons/waitress/blob/v1.4.4/src/waitress/server.py#L290-L291
parent d2653629
...@@ -65,7 +65,7 @@ class TimerServer(threading.Thread): ...@@ -65,7 +65,7 @@ class TimerServer(threading.Thread):
_module_name=module_name, _module_name=module_name,
_request=request, _request=request,
_response=response) _response=response)
server.add_task(self) server.task_dispatcher.add_task(self)
def cancel(self): def cancel(self):
pass pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment