Skip to content

Commit

Permalink
Prevent indexing errors for small batch sizes #11556 (#11557)
Browse files Browse the repository at this point in the history
  • Loading branch information
njkim authored Oct 21, 2024
1 parent f90e519 commit d0395e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arches/app/utils/index_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ def index_resources_using_singleprocessing(
bar = pyprind.ProgBar(resource_count, bar_char="█", title=title)
else:
bar = None

chunk_size = max(batch_size // 8, 8)
for resource in optimize_resource_iteration(
resources, chunk_size=batch_size // 8
resources, chunk_size=chunk_size
):
resource.tiles = resource.prefetched_tiles
resource.descriptor_function = resource.graph.descriptor_function
Expand Down Expand Up @@ -402,7 +402,7 @@ def index_resources_by_type(
def _index_resource_batch(resourceids, recalculate_descriptors, quiet=False):

resources = Resource.objects.filter(resourceinstanceid__in=resourceids)
batch_size = int(len(resourceids) / 2)
batch_size = max(len(resourceids) // 2, 1)
return index_resources_using_singleprocessing(
resources=resources,
batch_size=batch_size,
Expand Down
2 changes: 2 additions & 0 deletions releases/7.6.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
- Fixes failure to serialize non-editable Django fields (e.g. auto-date fields) #[11272](https://github.com/archesproject/arches/issues/11272)
- Fixes bug in which resource relationships fail to appear in visualize mode if using default deny as a non-superuser #[11539](https://github.com/archesproject/arches/pull/11539)
- Fixes bypassing of display logic of details table in search results for client-cached resources #[11537](https://github.com/archesproject/arches/issues/11537)
- Fixes the indexing error when the number of resources in a batch becomes smaller than 8 #[11556](https://github.com/archesproject/arches/issues/11556)
- Fail with 404 rather than 500 (AttributeError) for missing search components in search_home route #[11532](https://github.com/archesproject/arches/issues/11532)
- Adds an alert message before running the bulk deletion #[11405](https://github.com/archesproject/arches/issues/11405)


### Dependency changes:

```
Expand Down

0 comments on commit d0395e1

Please sign in to comment.