Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
renamed quit to stop
Browse files Browse the repository at this point in the history
  • Loading branch information
maaktweluit committed Sep 12, 2019
1 parent 906dee7 commit 959bd9c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions golem/task/requestedtaskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion golem/task/taskserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions tests/golem/task/test_requestedtaskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 959bd9c

Please sign in to comment.