From 959bd9cdadca16b7d963926290fe1afb43071b0b Mon Sep 17 00:00:00 2001 From: maaktweluit <10008353+maaktweluit@users.noreply.github.com> Date: Thu, 12 Sep 2019 17:31:47 +0200 Subject: [PATCH] renamed quit to stop --- golem/task/requestedtaskmanager.py | 8 +++----- golem/task/taskserver.py | 2 +- tests/golem/task/test_requestedtaskmanager.py | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/golem/task/requestedtaskmanager.py b/golem/task/requestedtaskmanager.py index c193331be5..64da7a5f0d 100644 --- a/golem/task/requestedtaskmanager.py +++ b/golem/task/requestedtaskmanager.py @@ -363,10 +363,8 @@ async def restart_task(self, task_id: TaskId) -> None: task.status = TaskStatus.waiting task.save() - async def quit(self): - logger.debug('quit()') - # Abort active tasks? - + async def stop(self): + logger.debug('stop()') # Shutdown registered app_clients for app_id, app_client in self._app_clients.items(): logger.info('Shutting down app. app_id=%r', app_id) @@ -377,7 +375,7 @@ async def quit(self): self._app_clients.clear() - logger.debug('quit() - DONE') + logger.debug('stop() - DONE') async def _get_app_client( self, diff --git a/golem/task/taskserver.py b/golem/task/taskserver.py index 2666fbd2f3..28971b1711 100644 --- a/golem/task/taskserver.py +++ b/golem/task/taskserver.py @@ -307,7 +307,7 @@ def resume(self): def quit(self): defer_rtm_quit = deferred_from_future( - self.requested_task_manager.quit() + self.requested_task_manager.stop() ) sync_wait(defer_rtm_quit) self.task_computer.quit() diff --git a/tests/golem/task/test_requestedtaskmanager.py b/tests/golem/task/test_requestedtaskmanager.py index b0297703e8..0961025aa6 100644 --- a/tests/golem/task/test_requestedtaskmanager.py +++ b/tests/golem/task/test_requestedtaskmanager.py @@ -261,13 +261,13 @@ async def _start_task(self, **golem_params): return task_id @pytest.mark.asyncio - async def test_quit(self, mock_client): + async def test_stop(self, mock_client): # given task_id = self._create_task() await self.rtm.init_task(task_id) # when - await self.rtm.quit() + await self.rtm.stop() # then mock_client.shutdown.assert_called_once_with()