squash! server : add server_task_type field to server_task_result

Add a check for the server_task_type in the server.cpp file. This is to
ensure that the server_task_type is correct when the server_task_type is
SERVER_TASK_TYPE_SLOT_RESTORE. This is because the server_task_type is
SERVER_TASK_TYPE_SLOT_SAVE when the server_task_type is
SERVER_TASK_TYPE_SLOT_RESTORE.
This commit is contained in:
Daniel Bevenius 2025-02-03 14:33:44 +01:00
parent c6f6579785
commit bfc342ca97

View file

@ -3738,7 +3738,11 @@ int main(int argc, char ** argv) {
return;
}
GGML_ASSERT(result.get() != nullptr);
GGML_ASSERT(result.get()->get_server_task_type() == type);
if (type == SERVER_TASK_TYPE_SLOT_RESTORE) {
GGML_ASSERT(result.get()->get_server_task_type() == SERVER_TASK_TYPE_SLOT_SAVE);
} else {
GGML_ASSERT(result.get()->get_server_task_type() == type);
}
res_ok(res, result->to_json());
};