Skip to content

Commit

Permalink
Start worker thread number at 1
Browse files Browse the repository at this point in the history
This number is only for human consumption and startng at 1 seems more
user friendly to me.
  • Loading branch information
NicolasLM committed Oct 10, 2018
1 parent af3526e commit 90ae385
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spinach/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, num_workers: int, namespace: str):
self._must_stop = threading.Event()
self.poison_pill = object()

for i in range(num_workers):
for i in range(1, num_workers + 1):
thread = threading.Thread(
target=self._worker_func,
name='{}-worker-{}'.format(self._namespace, i)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ def test_worker_signals(job):
mock_job_started_receiver.assert_called_once_with(ns, job=ANY)
mock_job_finished_receiver.assert_called_once_with(ns, job=ANY)
mock_worker_started_receiver.assert_called_once_with(
ns, worker_name='tests-worker-0'
ns, worker_name='tests-worker-1'
)
mock_worker_terminated_receiver.assert_called_once_with(
ns, worker_name='tests-worker-0'
ns, worker_name='tests-worker-1'
)


Expand Down

0 comments on commit 90ae385

Please sign in to comment.