Skip to content

[easylog]some improvement#1161

Open
qicosmos wants to merge 1 commit intomainfrom
improve_easylog
Open

[easylog]some improvement#1161
qicosmos wants to merge 1 commit intomainfrom
improve_easylog

Conversation

@qicosmos
Copy link
Copy Markdown
Collaborator

Why

appender belong to logger is more reasonable.

What is changing

Example

@github-actions
Copy link
Copy Markdown

for detail, goto summary download Artifacts base-ylt-cov-report(base commit coverage report) and ylt-cov-report(current pull request coverage report)

@poor-circle
Copy link
Copy Markdown
Collaborator

@qicosmos 检测出TSAN错误。

@poor-circle
Copy link
Copy Markdown
Collaborator

poor-circle commented Apr 3, 2026

@qicosmos
这里面的weak_ptr只延长了timer的生命周期,没有延迟this的生命周期。我感觉应该把session_manager做成shared_ptr然后继承enable_shared_from_this,最后在回调里面捕获session_manager的weak_ptr

  void start_check_session_timer() {
    std::lock_guard lock(timer_mtx_);
    std::weak_ptr<asio::steady_timer> timer = check_session_timer_;
    check_session_timer_->expires_after(check_session_duration_);
    check_session_timer_->async_wait([this, timer](auto ec) {
      auto ptr = timer.lock();
      if (ptr == nullptr) {
        return;
      }

      if (ec || stop_timer_) {
        return;
      }

      remove_expire_session();
      start_check_session_timer();
    });
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants