Skip to content

feat(php): waitForTasks param for various SearchClient methods #3565

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

Conversation

aykutersoy
Copy link
Contributor

@aykutersoy aykutersoy commented Aug 20, 2024

🧭 What and Why

  • We were calling waitForTask() for some SearchClient method calls (ie. deleteObjects) I thought since chuckedBatch is already doing this, why not add a parameter to hand over waitForTasks to Algolia client instead of us doing it manually.

🎟 JIRA Ticket: -

Changes included:

  • Adding new param ($waitForTasks) for
    • saveObjects()
    • deleteObjects()
    • partialUpdateObjects()
  • Fixing the docblock for $waitForTasks param chunkedBatch()

🧪 Test

added $waitForTasks param for various methods in SearchClient
@aykutersoy aykutersoy requested a review from a team as a code owner August 20, 2024 14:26
@aykutersoy aykutersoy requested review from Fluf22 and millotp August 20, 2024 14:26
@aykutersoy aykutersoy changed the title feat(php): waitForTasks feat(php): waitForTasks param for various SearchClient methods Aug 20, 2024
Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good for the other helpers, but I don't think its possible for replaceAllObjects

*/
public function replaceAllObjects($indexName, $objects, $batchSize = 1000, $requestOptions = [])
public function replaceAllObjects($indexName, $objects, $batchSize = 1000, $requestOptions = [], $waitForTasks = true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The waitForTask is required for this helper to work properly, without this it might end up in a infinite loop so I would recommend to leave it as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted! Thanks for your comment and reviewing this 🙌

…rchClient' of github.com:aykutersoy/api-clients-automation into feat/php-waitForTasks-param-for-various-methods-for-SearchClient
Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good :)

@aykutersoy
Copy link
Contributor Author

@millotp Amazing! Thank you very much for speedy review and approval 🙌

@millotp
Copy link
Collaborator

millotp commented Aug 20, 2024

you're welcome ! I will merge both of your PR once the CI on main is finished

@millotp millotp merged commit d0e4f4e into algolia:main Aug 20, 2024
3 checks passed
algolia-bot added a commit that referenced this pull request Aug 20, 2024
algolia-bot added a commit to algolia/algoliasearch-client-php that referenced this pull request Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants