diff --git a/src/server/main_service.cc b/src/server/main_service.cc index a677d3e4fed3..f855a78a4644 100644 --- a/src/server/main_service.cc +++ b/src/server/main_service.cc @@ -1127,8 +1127,6 @@ void Service::DispatchCommand(CmdArgList args, facade::ConnectionContext* cntx) cntx->paused = false; } - etl.RecordCmd(); - if (auto err = VerifyCommandState(cid, args_no_cmd, *dfly_cntx); err) { if (auto& exec_info = dfly_cntx->conn_state.exec_info; exec_info.IsCollecting()) exec_info.state = ConnectionState::ExecInfo::EXEC_ERROR; @@ -1246,6 +1244,8 @@ bool Service::InvokeCmd(const CommandId* cid, CmdArgList tail_args, ConnectionCo DispatchMonitor(cntx, cid, tail_args); } + ServerState::tlocal()->RecordCmd(); + #ifndef NDEBUG // Verifies that we reply to the client when needed. ReplyGuard reply_guard(cntx, cid->name());