From 858f08514b670eb6851e4decdcbd46700650aa9c Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Tue, 4 Feb 2020 19:42:14 +0300 Subject: [PATCH] Make apply_packages phase more apparent (#956) --- repology/update/__init__.py | 10 ++++++---- ...ate_post_packages.sql => update_apply_packages.sql} | 0 2 files changed, 6 insertions(+), 4 deletions(-) rename sql.d/update/{update_post_packages.sql => update_apply_packages.sql} (100%) diff --git a/repology/update/__init__.py b/repology/update/__init__.py index d7352d32e..a69fff2d3 100644 --- a/repology/update/__init__.py +++ b/repology/update/__init__.py @@ -104,14 +104,16 @@ def update_repology(database: Database, projects: Iterable[List[Package]], logge # This was picked randomly enable_analyze = stats.change_fraction > 0.05 - logger.log('finalizing projects update') - database.update_post_packages(enable_partial, enable_analyze) - logger.log('updating field statistics') - for repo, field_stats in field_stats_per_repo.items(): database.update_repository_used_package_fields(repo, field_stats.get_used_fields()) + # Note: before this, packages table still contains old versions of packages, + # while new versions reside in incoming_packages temporary table + logger.log('applying updated packages') + database.update_apply_packages(enable_partial, enable_analyze) + # Note: after this, packages table contain new versions of packages + logger.log('updating metapackages') database.update_metapackages() diff --git a/sql.d/update/update_post_packages.sql b/sql.d/update/update_apply_packages.sql similarity index 100% rename from sql.d/update/update_post_packages.sql rename to sql.d/update/update_apply_packages.sql