chore: limit traffic logger only to the main interface (#2877)

This commit is contained in:
Roman Gershman 2024-04-10 14:27:55 +03:00 committed by GitHub
parent eb164be596
commit dd437693f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -968,9 +968,11 @@ Connection::ParserStatus Connection::ParseRedis(SinkReplyBuilder* orig_builder)
bool has_more = consumed < io_buf_.InputLen();
if (tl_traffic_logger.log_file) // Log command as soon as we receive it
LogTraffic(id_, has_more, absl::MakeSpan(parse_args));
if (tl_traffic_logger.log_file) {
if (IsMain()) { // log only on the main interface.
LogTraffic(id_, has_more, absl::MakeSpan(parse_args));
}
}
DispatchCommand(has_more, dispatch_sync, dispatch_async);
}
io_buf_.ConsumeInput(consumed);