Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Use collection_exists to test existence #11424

Conversation

sunxiaoguang
Copy link
Contributor

@sunxiaoguang sunxiaoguang commented Dec 6, 2024

Summary

We used get_collections previously to test if a collection with given name exists. When the number of collections gets big, it's slower than simply calling collection_exists instead. This PR tries to use collection_exists for this case.

Tip

Close issue syntax: Fixes #<issue number> or Resolves #<issue number>, see documentation for more details.

Screenshots

Before After
... ...

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Dec 6, 2024
@sunxiaoguang sunxiaoguang force-pushed the optimize_collection_exist_check branch from 49b0445 to 4f89489 Compare December 6, 2024 06:55
@sunxiaoguang
Copy link
Contributor Author

Client has to be updated as well. Will come back later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant