| 51 | } |
| 52 | |
| 53 | void ClusterEvents::EnqueueCheck(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params) |
| 54 | { |
| 55 | static boost::once_flag once = BOOST_ONCE_INIT; |
| 56 | |
| 57 | boost::call_once(once, []() { |
| 58 | m_LogTimer = Timer::Create(); |
| 59 | m_LogTimer->SetInterval(10); |
| 60 | m_LogTimer->OnTimerExpired.connect([](const Timer * const&) { LogRemoteCheckQueueInformation(); }); |
| 61 | m_LogTimer->Start(); |
| 62 | }); |
| 63 | |
| 64 | std::unique_lock<std::mutex> lock(m_Mutex); |
| 65 | |
| 66 | if (m_CheckRequestQueue.size() >= 25000) { |
| 67 | m_ChecksDroppedDuringInterval++; |
| 68 | return; |
| 69 | } |
| 70 | |
| 71 | m_CheckRequestQueue.emplace_back([origin, params]() { ExecuteCheckFromQueue(origin, params); }); |
| 72 | |
| 73 | if (!m_CheckSchedulerRunning) { |
| 74 | std::thread t(ClusterEvents::RemoteCheckThreadProc); |
| 75 | t.detach(); |
| 76 | m_CheckSchedulerRunning = true; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | static void SendEventExecutedCommand(const Dictionary::Ptr& params, long exitStatus, const String& output, |
| 81 | double start, double end, const ApiListener::Ptr& listener, const MessageOrigin::Ptr& origin, |
nothing calls this directly
no test coverage detected