Skip to content

Commit

Permalink
Search index rebuild takes a while; let's give it a progress counter
Browse files Browse the repository at this point in the history
  • Loading branch information
deniszgonjanin committed Sep 14, 2015
1 parent c991cd6 commit 03c1ce0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ckan/lib/search/__init__.py
Expand Up @@ -183,7 +183,12 @@ def rebuild(package_id=None, only_missing=False, force=False, refresh=False, def
if not refresh:
package_index.clear()

for pkg_id in package_ids:
total_packages = len(package_ids)
for counter, pkg_id in enumerate(package_ids):
sys.stdout.write(
"\rIndexing dataset {0}/{1}".format(counter, total_packages)
)
sys.stdout.flush()
try:
package_index.update_dict(
logic.get_action('package_show')(context,
Expand Down

0 comments on commit 03c1ce0

Please sign in to comment.