mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-12-17 09:57:00 +00:00
Compare commits
6 Commits
prototype-
...
fix-payloa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac428b5d7c | ||
|
|
1291990f7d | ||
|
|
2b6b4284bb | ||
|
|
018cad1781 | ||
|
|
26e368b116 | ||
|
|
ba95ac0915 |
12
.github/workflows/sdks-tests.yml
vendored
12
.github/workflows/sdks-tests.yml
vendored
@@ -25,14 +25,18 @@ jobs:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Define the Docker image we need to use
|
||||
id: define-image
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
DOCKER_IMAGE_INPUT: ${{ github.event.inputs.docker_image }}
|
||||
run: |
|
||||
event=${{ github.event_name }}
|
||||
echo "docker-image=nightly" >> $GITHUB_OUTPUT
|
||||
if [[ $event == 'workflow_dispatch' ]]; then
|
||||
echo "docker-image=${{ github.event.inputs.docker_image }}" >> $GITHUB_OUTPUT
|
||||
if [[ "$EVENT_NAME" == 'workflow_dispatch' ]]; then
|
||||
echo "docker-image=$DOCKER_IMAGE_INPUT" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Docker image is ${{ steps.define-image.outputs.docker-image }}
|
||||
run: echo "Docker image is ${{ steps.define-image.outputs.docker-image }}"
|
||||
env:
|
||||
DOCKER_IMAGE: ${{ steps.define-image.outputs.docker-image }}
|
||||
run: echo "Docker image is $DOCKER_IMAGE"
|
||||
|
||||
##########
|
||||
## SDKs ##
|
||||
|
||||
2
.github/workflows/test-suite.yml
vendored
2
.github/workflows/test-suite.yml
vendored
@@ -196,7 +196,7 @@ jobs:
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: --all-targets ${{ matrix.features }} -- --deny warnings
|
||||
args: --all-targets ${{ matrix.features }} -- --deny warnings -D clippy::todo
|
||||
|
||||
fmt:
|
||||
name: Run Rustfmt
|
||||
|
||||
@@ -745,6 +745,7 @@ impl IndexScheduler {
|
||||
mut current_batch: ProcessingBatch,
|
||||
) -> Result<Option<(Batch, ProcessingBatch)>> {
|
||||
current_batch.processing(Some(&mut task));
|
||||
current_batch.reason(BatchStopReason::NetworkTask { id: task.uid });
|
||||
|
||||
let change_version =
|
||||
task.network.as_ref().map(|network| network.network_version()).unwrap_or_default();
|
||||
@@ -777,11 +778,16 @@ impl IndexScheduler {
|
||||
task_version >= change_version
|
||||
});
|
||||
|
||||
let (batch, current_batch) = res?;
|
||||
let (batch, mut current_batch) = res?;
|
||||
|
||||
let batch = match batch {
|
||||
Some(batch) => {
|
||||
let inner_batch = Box::new(batch);
|
||||
let inner_reason = current_batch.reason.to_string();
|
||||
current_batch.reason(BatchStopReason::NetworkTaskOlderTasks {
|
||||
id: task.uid,
|
||||
inner_reason,
|
||||
});
|
||||
|
||||
Batch::NetworkIndexBatch { network_task: task, inner_batch }
|
||||
}
|
||||
@@ -819,10 +825,15 @@ impl IndexScheduler {
|
||||
task_version != change_version
|
||||
});
|
||||
|
||||
let (batch, current_batch) = res?;
|
||||
let (batch, mut current_batch) = res?;
|
||||
|
||||
let batch = batch.map(|batch| {
|
||||
let inner_batch = Box::new(batch);
|
||||
let inner_reason = current_batch.reason.to_string();
|
||||
current_batch.reason(BatchStopReason::NetworkTaskImportTasks {
|
||||
id: task.uid,
|
||||
inner_reason,
|
||||
});
|
||||
|
||||
(Batch::NetworkIndexBatch { network_task: task, inner_batch }, current_batch)
|
||||
});
|
||||
|
||||
@@ -899,6 +899,17 @@ pub enum BatchStopReason {
|
||||
SettingsWithDocumentOperation {
|
||||
id: TaskId,
|
||||
},
|
||||
NetworkTask {
|
||||
id: TaskId,
|
||||
},
|
||||
NetworkTaskOlderTasks {
|
||||
id: TaskId,
|
||||
inner_reason: String,
|
||||
},
|
||||
NetworkTaskImportTasks {
|
||||
id: TaskId,
|
||||
inner_reason: String,
|
||||
},
|
||||
}
|
||||
|
||||
impl BatchStopReason {
|
||||
@@ -987,6 +998,24 @@ impl Display for BatchStopReason {
|
||||
"stopped before task with id {id} because it is a document operation which cannot be batched with settings changes"
|
||||
)
|
||||
}
|
||||
BatchStopReason::NetworkTask { id } => {
|
||||
write!(
|
||||
f,
|
||||
"stopped after task with id {id} because it is a network topology change task"
|
||||
)
|
||||
}
|
||||
BatchStopReason::NetworkTaskOlderTasks { id, inner_reason } => {
|
||||
write!(
|
||||
f,
|
||||
"stopped after batching network task with id {id} and a batch of older tasks: {inner_reason}"
|
||||
)
|
||||
}
|
||||
BatchStopReason::NetworkTaskImportTasks { id, inner_reason } => {
|
||||
write!(
|
||||
f,
|
||||
"stopped after batching network task with id {id} and a batch of import tasks: {inner_reason}"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,12 +271,13 @@ impl ErrorCode for PayloadError {
|
||||
PayloadError::Payload(e) => match e {
|
||||
ActixPayloadError::IncompleteError => Code::BadRequest,
|
||||
ActixPayloadError::OtherError(error) => match error {
|
||||
aweb::error::PayloadError::EncodingCorrupted => Code::Internal,
|
||||
aweb::error::PayloadError::EncodingCorrupted => Code::BadRequest,
|
||||
aweb::error::PayloadError::Overflow => Code::PayloadTooLarge,
|
||||
aweb::error::PayloadError::UnknownLength => Code::Internal,
|
||||
aweb::error::PayloadError::Http2Payload(_) => Code::Internal,
|
||||
aweb::error::PayloadError::UnknownLength => Code::BadRequest,
|
||||
aweb::error::PayloadError::Http2Payload(_) => Code::BadRequest,
|
||||
aweb::error::PayloadError::Io(_) => Code::Internal,
|
||||
_ => todo!(),
|
||||
aweb::error::PayloadError::Incomplete(_) => Code::BadRequest,
|
||||
_ => Code::Internal,
|
||||
},
|
||||
},
|
||||
PayloadError::Json(err) => match err {
|
||||
|
||||
Reference in New Issue
Block a user