From 7c6ce726aa99a99c553b94631ad590d007cdaad1 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 22 Apr 2018 15:14:47 +0100 Subject: [PATCH] ansible: rename variable to reflect correct time unit --- ansible_mitogen/services.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible_mitogen/services.py b/ansible_mitogen/services.py index d2cb9355..79c8de46 100644 --- a/ansible_mitogen/services.py +++ b/ansible_mitogen/services.py @@ -422,7 +422,7 @@ class FileService(mitogen.service.Service): #: max_queue_size=1MiB and a sleep of 10ms, maximum throughput on any #: single stream is 112MiB/sec, which is >5x what SSH can handle on my #: laptop. - sleep_delay_ms = 0.01 + sleep_delay_secs = 0.01 def __init__(self, router): super(FileService, self).__init__(router) @@ -430,7 +430,7 @@ class FileService(mitogen.service.Service): self._size_by_path = {} #: Queue used to communicate from service to scheduler thread. self._queue = mitogen.core.Latch() - #: Mapping of Stream->[(sender, fp)]. + #: Mapping of Stream->[(Sender, file object)]. self._pending_by_stream = {} self._thread = threading.Thread(target=self._scheduler_main) self._thread.start() @@ -488,9 +488,9 @@ class FileService(mitogen.service.Service): def _sleep_on_queue(self): """ - Sleep indefinitely (no active transfers) or for :attr:`sleep_delay_ms` - (active transfers) waiting for a new transfer request to arrive from - the :meth:`fetch` method. + Sleep indefinitely (no active transfers) or for + :attr:`sleep_delay_secs` (active transfers) waiting for a new transfer + request to arrive from the :meth:`fetch` method. If a new request arrives, add it to the appropriate list in :attr:`_pending_by_stream`. @@ -501,7 +501,7 @@ class FileService(mitogen.service.Service): :data:`False`. """ if self._pending_by_stream: - timeout = self.sleep_delay_ms + timeout = self.sleep_delay_secs else: timeout = None