Skip to content

Commit 17590bc

Browse files
committed
fix(#832): fixed task-abort in model
In the task-processing of the models, the abort was not handled correctly, which blocked the model even from deletion. Signed-off-by: Tobias Anker <tobias.anker@kitsunemimi.moe>
1 parent 4d67034 commit 17590bc

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/binaries/sakura/src/api/http_endpoints/model/delete_model_internal_v1_0.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ pub async fn delete_model_internal(
3838
model_uuid: Path<Uuid>,
3939
context: UserContext,
4040
) -> Result<NoContent, ErrorResponse> {
41-
// delete model from database
42-
model_table::delete_model(&model_uuid, &context)
43-
.map_err(|e| map_db_uuid_get_delete_error("model", &model_uuid, e))?;
44-
4541
// delete model from core
4642
let mut model_handle = model_handler::CLUSTER_HANDLER
4743
.write()
@@ -50,5 +46,9 @@ pub async fn delete_model_internal(
5046
.delete_model(&model_uuid)
5147
.map_err(map_ainari_error_to_api_response)?;
5248

49+
// delete model from database
50+
model_table::delete_model(&model_uuid, &context)
51+
.map_err(|e| map_db_uuid_get_delete_error("model", &model_uuid, e))?;
52+
5353
Ok(NoContent)
5454
}

src/binaries/sakura/src/core/processing/tasks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl Task {
177177
pub fn start_task(&mut self) -> bool {
178178
// check if task was aborted
179179
if task_table::is_aborted(&self.uuid) {
180-
return true;
180+
return false;
181181
}
182182

183183
{
@@ -301,7 +301,7 @@ impl Task {
301301
&(self.meta.number_of_finished_cycles as i64),
302302
);
303303
if task_table::is_aborted(&self.uuid) {
304-
// TODO: handle abort correctly
304+
self.meta.is_finished = true;
305305
return;
306306
}
307307
}

0 commit comments

Comments
 (0)