From 3b351b30f00908db0e522b90071acf3d32aff7e6 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 6 Dec 2020 11:58:46 -0800 Subject: [PATCH] ircd::m::room::state: Improve log/diagnostic on rebuild. --- matrix/room_state.cc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/matrix/room_state.cc b/matrix/room_state.cc index f25d7a972..3c0136156 100644 --- a/matrix/room_state.cc +++ b/matrix/room_state.cc @@ -981,24 +981,24 @@ ircd::m::room::state::rebuild::rebuild(const room::id &room_id) room::auth::passfail{true, {}} }; - if(!pass) + if(likely(pass)) { - log::dwarning - { - log, "%s fails for present state in %s :%s", - string_view{event.event_id}, - string_view{room_id}, - what(fail), - }; - - return true; + auto _opts(opts); + _opts.op = db::op::SET; + _opts.event_idx = event_idx; + dbs::write(txn, event, _opts); + ++added; } - auto _opts(opts); - _opts.op = db::op::SET; - _opts.event_idx = event_idx; - dbs::write(txn, event, _opts); - ++added; + log::logf + { + log, pass? log::level::DEBUG: log::level::DWARNING, + "%s in %s present state :%s", + string_view{event.event_id}, + string_view{room_id}, + pass? "PASS"_sv: what(fail), + }; + return true; });