Fix CPU 100% usage by websocket error handling improvement (#1327)
This commit is contained in:
parent
22d8ef75e0
commit
fd10d1c9f8
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2022 Memgraph Ltd.
|
// Copyright 2023 Memgraph Ltd.
|
||||||
//
|
//
|
||||||
// Use of this software is governed by the Business Source License
|
// Use of this software is governed by the Business Source License
|
||||||
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||||
@ -175,6 +175,11 @@ void Session::OnRead(const boost::beast::error_code ec, const size_t /*bytes_tra
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ec) {
|
||||||
|
LogError(ec, "read");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsAuthenticated()) {
|
if (!IsAuthenticated()) {
|
||||||
auto response = nlohmann::json();
|
auto response = nlohmann::json();
|
||||||
auto auth_failed = [this, &response](const std::string &message) {
|
auto auth_failed = [this, &response](const std::string &message) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2022 Memgraph Ltd.
|
// Copyright 2023 Memgraph Ltd.
|
||||||
//
|
//
|
||||||
// Use of this software is governed by the Business Source License
|
// Use of this software is governed by the Business Source License
|
||||||
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||||
|
Loading…
Reference in New Issue
Block a user