mirror of
https://github.com/typesense/typesense.git
synced 2025-05-22 23:06:30 +08:00
When alter fails unexpectedly, reset alter running state.
This commit is contained in:
parent
4e7da7c643
commit
8047b9f359
@ -291,12 +291,18 @@ void BatchedIndexer::run() {
|
||||
try {
|
||||
found_rpath->handler(orig_req, orig_res);
|
||||
} catch(const std::exception& e) {
|
||||
LOG(ERROR) << "Exception while calling handler " << found_rpath->_get_action();
|
||||
const std::string& api_action = found_rpath->_get_action();
|
||||
LOG(ERROR) << "Exception while calling handler " << api_action;
|
||||
LOG(ERROR) << "Raw error: " << e.what();
|
||||
// bad request gets a response immediately
|
||||
orig_res->set_400("Bad request.");
|
||||
orig_res->final = true;
|
||||
async_res = false;
|
||||
|
||||
// clean up state
|
||||
if(api_action == "collections:update") {
|
||||
set_alter_in_progress(false);
|
||||
}
|
||||
}
|
||||
prev_body = orig_req->body;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user