Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions worker/src/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ void Worker::requestPolicyFromController() {
GetPolicyResponse resp;
grpc::ClientContext context;

auto deadline = std::chrono::system_clock::now() + std::chrono::seconds(5);
context.set_deadline(deadline);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кажется, логировать это нужно еще


auto status = stub_->GetPolicy(&context, req, &resp);

if (!status.ok()) {
Expand Down Expand Up @@ -283,6 +286,9 @@ bool Worker::classify(const std::string &type, const std::string &target,
ClassifyResponse resp;
grpc::ClientContext context;

auto deadline = std::chrono::system_clock::now() + std::chrono::seconds(5);
context.set_deadline(deadline);

auto status = stub_->Classify(&context, req, &resp);
if (!status.ok()) {
spdlog::error("Classify failed: " + status.error_message());
Expand Down
Loading