-
Notifications
You must be signed in to change notification settings - Fork 87
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
Add cancel task api for v0.30.0 #395
Add cancel task api for v0.30.0 #395
Conversation
d6bad58
to
478217b
Compare
type CancelTasksQuery struct { | ||
UIDS []int64 | ||
IndexUIDS []string | ||
Statuses []string | ||
Types []string | ||
BeforeEnqueuedAt time.Time | ||
AfterEnqueuedAt time.Time | ||
BeforeStartedAt time.Time | ||
AfterStartedAt time.Time | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type CancelTasksQuery struct { | |
UIDS []int64 | |
IndexUIDS []string | |
Statuses []string | |
Types []string | |
BeforeEnqueuedAt time.Time | |
AfterEnqueuedAt time.Time | |
BeforeStartedAt time.Time | |
AfterStartedAt time.Time | |
} | |
type CancelTasksQuery struct { | |
UIDS []int64 | |
IndexUIDS []string | |
Statuses []string | |
Types []string | |
BeforeEnqueuedAt time.Time | |
AfterEnqueuedAt time.Time | |
BeforeStartedAt time.Time | |
AfterStartedAt time.Time | |
BeforeFinishedAt time.Time | |
AfterFinishedAt time.Time | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't add those two filters because they didn't make sense, and they are not in the parameters available in the documentation. Are you sure it's a good think to add it?
BeforeStartedAt: param.BeforeStartedAt, | ||
AfterStartedAt: param.AfterStartedAt, | ||
} | ||
encodeTasksQuery(paramToSend, &req) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this function encodeTasksQuery
support multiple sets of params?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, I could put interface{}
as a parameter instead of a typed struct, but I wouldn't have access to the fields easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Add delete task api for v0.30.0
…30.0 Add swap indexes api for v0.30.0
27db98e
to
a55baa0
Compare
382: Changes related to the next Meilisearch release (v0.30.0) r=alallema a=meili-bot Related to this issue: meilisearch/integration-guides#221 This PR: - gathers the changes related to the next Meilisearch release (v0.30.0) so that this package is ready when the official release is out. - should pass the tests against the [latest pre-release of Meilisearch](https://github.com/meilisearch/meilisearch/releases). - might eventually contain test failures until the Meilisearch v0.30.0 is out.⚠️ This PR should NOT be merged until the next release of Meilisearch (v0.30.0) is out. _This PR is auto-generated for the [pre-release week](https://github.com/meilisearch/integration-guides/blob/main/resources/pre-release-week.md) purpose._ Done: - #390 - #392 - #395 - #396 - #397 Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com> Co-authored-by: Amélie <alallema@users.noreply.github.com> Co-authored-by: alallema <amelie@meilisearch.com>
398: Update version for the next release (0.22.0) r=alallema a=alallema This version makes this package compatible with Meilisearch v0.30.0 🎉 Check out the changelog of [Meilisearch v0.30.0](https://github.com/meilisearch/meilisearch/releases/tag/v0.30.0) for more information on the changes. ## 🚀 Enhancements - New `pagination` strategy with the search parameters `Page` and `HitsPerPage` #392 - New filters on `GetTasks`: `UID`, `BeforeEnqueuedAt`, `AfterEnqueuedAt`, ... see #390 - New `client.CancelTasks` method that lets you cancel `enqueued` and `processing` tasks #395 - New `client.DeleteTasks` method that lets you delete tasks #396 - New `client.SwapIndexes` method that lets you swap two indexes #397 - New fields on `Task.Details` #395 ##⚠️ Breaking change - Parameters on `GetTasks` name changes: #390 - `Status` -> `Statuses` - `IndexUID` -> `IndexUIDS` - `Type` -> `Types` Co-authored-by: alallema <amelie@meilisearch.com> Co-authored-by: Amélie <alallema@users.noreply.github.com>
Add the cancel task api see spec: meilisearch/specifications#195
Task
structurecanceledBy
TaskInfo
structureStatus
,Type
,TaskUID
,IndexUID
andEnqueuedAt
are no longer optional.CancelTasks()
in the clientTasksQuery
TaskInfo
Tasks.Details
fields: