From 7d19ea84ab0fd29efbef69fae4b361b1900005ba Mon Sep 17 00:00:00 2001 From: John Colvin Date: Sun, 16 Apr 2023 15:06:40 +0000 Subject: [PATCH] chore: Remove redundant fn 'get_thread_name' --- src/server/sparkd/cmds/md/cmds/Run.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/server/sparkd/cmds/md/cmds/Run.cpp b/src/server/sparkd/cmds/md/cmds/Run.cpp index 591d8d745..4c779ad9d 100644 --- a/src/server/sparkd/cmds/md/cmds/Run.cpp +++ b/src/server/sparkd/cmds/md/cmds/Run.cpp @@ -18,12 +18,6 @@ namespace bts::cmds::md::cmds { static std::optional _md_thread; -std::string get_thread_name() { - std::string rv; - os::get_thread_name(&rv); - return rv; -} - static void boot_sleep() { auto conf = config::get(); const auto *start = &conf.standard_start(); @@ -38,18 +32,18 @@ static void boot_sleep() { if (datetime::is_local_time_between(hh_start, mm_start, hh_end, mm_end)) { auto sleep_period = std::chrono::seconds(conf.delay_seconds()); LOG(md, Info, "Run::boot_sleep t_id{} t_name:{} sleep_period:{}", - os::get_thread_id(), get_thread_name(), sleep_period.count()); + os::get_thread_id(), os::get_thread_name(), sleep_period.count()); std::this_thread::sleep_for(sleep_period); } else { LOG(md, Info, "Run::boot_sleep t_id{} t_name:{} sleep_period:{}", - os::get_thread_id(), get_thread_name(), 2); + os::get_thread_id(), os::get_thread_name(), 2); std::this_thread::sleep_for(2s); } } static void run_replay() { LOG(md, Info, "Run::run_replay t_id:{} t_name", os::get_thread_id(), - get_thread_name()); + os::get_thread_name()); const auto &replay_opts = config::get(); bts::md::replay_recording( replay_opts.url(), config::get().naggle_ms(), @@ -60,7 +54,7 @@ static void run_onixs( bts::md::MBOWriter *mbo_writer, bts::md::TradeSummarySignalDispatcher *tss_dispatcher) { LOG(md, Info, "Run::run_onixs t_id:{} t_name", os::get_thread_id(), - get_thread_name()); + os::get_thread_name()); std::vector> platforms; // get all glbx symbols std::vector cme_symbols; @@ -102,7 +96,7 @@ static void run_emumba() { static void run_md_gwy() { LOG(md, Info, "Run::run_md_gwy t_id:{} t_name:{}", os::get_thread_id(), - get_thread_name()); + os::get_thread_name()); // bts::md::CCMain cc_main = {}; // cc_main.run(); bts::md::MarketDataGateway gwy = {}; @@ -118,7 +112,7 @@ void Run::run( bool run_on_md_thread) { md::cmds::Cleanup::execute(); LOG(md, Info, "Run::run cleanup:{} run_on_md_thread:{} t_id:{} t_name:{}", - cleanup, run_on_md_thread, os::get_thread_id(), get_thread_name()); + cleanup, run_on_md_thread, os::get_thread_id(), os::get_thread_name()); if (type == Run::MDType::Configured && !config::get().use_md()) { LOG(md, Info, "Ignoring request to run md: 'use_md' is configured false"); @@ -127,7 +121,7 @@ void Run::run( auto impl = [&mbo_writer, &tss_dispatcher, &type, &cleanup]() { LOG(md, Info, "Run::impl lambda t_id: {} t_name: {}", os::get_thread_id(), - get_thread_name()); + os::get_thread_name()); if (cleanup) md::cmds::Cleanup::execute(); if (type == Run::MDType::Configured) {