From 9cba8c7f6ce96d797815869d4d40cbb9d432a1d8 Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 10 Apr 2023 16:31:52 -0600 Subject: [PATCH] Renaming cleanup flag to refresh_cleanup. Updating refresh progress test. --- wrolpi/files/lib.py | 6 +++--- wrolpi/files/test/test_lib.py | 3 ++- wrolpi/flags.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wrolpi/files/lib.py b/wrolpi/files/lib.py index 8c85960e..1b9ad326 100644 --- a/wrolpi/files/lib.py +++ b/wrolpi/files/lib.py @@ -492,7 +492,7 @@ async def refresh_files(paths: List[pathlib.Path] = None, send_events: bool = Tr Events.send_global_refresh_indexing_completed() # Cleanup any outdated file data. - with flags.cleanup: + with flags.refresh_cleanup: await apply_refresh_cleanup() if send_events: Events.send_global_after_refresh_completed() @@ -862,15 +862,15 @@ def get_refresh_progress(): results = dict(curs.fetchone()) status = dict( - cleanup=flags.cleanup.is_set(), + counted_files=REFRESH.get('counted_files', 0), counting=flags.refresh_counting.is_set(), discovery=flags.refresh_discovery.is_set(), indexed=results['indexed'], indexing=flags.refresh_indexing.is_set(), modeled=results['modeled'], modeling=flags.refresh_modeling.is_set(), + cleanup=flags.refresh_cleanup.is_set(), refreshing=flags.refreshing.is_set(), - counted_files=REFRESH.get('counted_files', 0), total_file_groups=results['total_file_groups'], unindexed=results['unindexed'], ) diff --git a/wrolpi/files/test/test_lib.py b/wrolpi/files/test/test_lib.py index 964d84a3..d9507bdb 100644 --- a/wrolpi/files/test/test_lib.py +++ b/wrolpi/files/test/test_lib.py @@ -579,7 +579,8 @@ def test_get_refresh_progress(test_client, test_session): assert 'modeled' in progress assert 'modeling' in progress assert 'refreshing' in progress - assert 'total_files' in progress + assert 'counted_files' in progress + assert 'total_file_groups' in progress assert 'unindexed' in progress diff --git a/wrolpi/flags.py b/wrolpi/flags.py index 1f90121f..c1c003fe 100644 --- a/wrolpi/flags.py +++ b/wrolpi/flags.py @@ -115,7 +115,7 @@ refresh_counting = Flag('refresh_counting') refresh_discovery = Flag('refresh_discovery') refresh_modeling = Flag('refresh_modeling') refresh_indexing = Flag('refresh_indexing') -cleanup = Flag('cleanup') +refresh_cleanup = Flag('refresh_cleanup') # The global refresh has been performed. This is False on a fresh instance of WROLPi. refresh_complete = Flag('refresh_complete', store_db=True)