Skip to content

Commit

Permalink
Fix AccumulatedIndexer to work with updated meilisearch
Browse files Browse the repository at this point in the history
In 7db8492 we bumped up meilisearch from `v0.16.0`
to `v1.6.1`. To take into account the changed APIs,
we made appropriate changes to the `create_index`
function: 7db8492#diff-f19db9be4450da07fbdc4f72ff25a2f7163caad1380a3d5b6176afd458f81c3f

But we missed changing `AccumulatedIndexer`. As a
consequence, showing "waiting for index to be ready..."
was broken. In this change, we fix that.
  • Loading branch information
mr-pennyworth committed Jun 23, 2024
1 parent de3aba0 commit 8c265ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyapp/BetterDict.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ def add(self, items):
self.items.extend(items)

def finish(self):
updateId = self.index.add_documents(self.items)["updateId"]
task_info = self.index.add_documents(self.items)

def status():
return self.index.get_update_status(updateId)["status"]
return self.index.get_task(task_info.task_uid).status

ipb = IndefiniteProgressBar(title="Waiting for index to be ready...")
while (s := status()) != "processed":
while (s := status()) != "succeeded":
ipb.update(message="")
time.sleep(2)
ipb.finish()
Expand Down

0 comments on commit 8c265ae

Please sign in to comment.