mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Smaller batch for tunnel write to debug
This commit is contained in:
parent
2dea1c3b11
commit
6382cd3962
1 changed files with 3 additions and 4 deletions
|
@ -85,7 +85,7 @@ void UdpServerTunnelImpl::send(td::UdpMessage &&message) {
|
|||
out_buf_msg_num_++;
|
||||
|
||||
|
||||
if (out_buf_msg_num_ == 100) {
|
||||
if (out_buf_msg_num_ == 3) {
|
||||
WriteTunnel(tunnel_index_, out_buf_, out_buf_msg_num_);
|
||||
|
||||
out_buf_offset_ = 0;
|
||||
|
@ -95,15 +95,14 @@ void UdpServerTunnelImpl::send(td::UdpMessage &&message) {
|
|||
}
|
||||
|
||||
void UdpServerTunnelImpl::alarm() {
|
||||
auto now = Time::now();
|
||||
if (out_buf_msg_num_ > 0 && now-last_batch_at_ >= 0.02) {
|
||||
if (out_buf_msg_num_ > 0 && Time::now()-last_batch_at_ >= 0.02) {
|
||||
td::Timer timer;
|
||||
WriteTunnel(tunnel_index_, out_buf_, out_buf_msg_num_);
|
||||
// LOG(ERROR) << "Sending messages from alarm " << out_buf_msg_num_ << " | " << timer.elapsed();
|
||||
|
||||
out_buf_offset_ = 0;
|
||||
out_buf_msg_num_ = 0;
|
||||
last_batch_at_ = now;
|
||||
last_batch_at_ = Time::now();
|
||||
}
|
||||
|
||||
alarm_timestamp() = td::Timestamp::in(0.02);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue