diff --git a/requirements-swh.txt b/requirements-swh.txt --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -3,4 +3,4 @@ swh.objstorage >= 0.0.28 swh.scheduler >= 0.0.47 swh.storage >= 0.0.156 -swh.journal >= 0.0.27 +swh.journal >= 0.0.29 diff --git a/swh/indexer/cli.py b/swh/indexer/cli.py --- a/swh/indexer/cli.py +++ b/swh/indexer/cli.py @@ -1,11 +1,10 @@ -# Copyright (C) 2019 The Software Heritage developers +# Copyright (C) 2019-2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import functools import json -import time import click @@ -222,18 +221,14 @@ 'origin_metadata': origin_metadata_task_type, } ) - nb_messages = 0 - last_log_time = 0 try: - while not stop_after_objects or nb_messages < stop_after_objects: - nb_messages += client.process(worker_fn) - if time.monotonic() - last_log_time >= 60: - print('Processed %d messages.' % nb_messages) - last_log_time = time.monotonic() + client.process(worker_fn) except KeyboardInterrupt: ctx.exit(0) else: print('Done.') + finally: + client.close() @cli.command('rpc-serve') diff --git a/swh/indexer/tests/test_cli.py b/swh/indexer/tests/test_cli.py --- a/swh/indexer/tests/test_cli.py +++ b/swh/indexer/tests/test_cli.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019 The Software Heritage developers +# Copyright (C) 2019-2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -346,7 +346,6 @@ # Check the output expected_output = ( - 'Processed 1 messages.\n' 'Done.\n' ) assert result.exit_code == 0, result.output