MCPcopy Create free account
hub / github.com/domoticz/domoticz / StartEventSystem

Method StartEventSystem

main/EventSystem.cpp:154–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void CEventSystem::StartEventSystem()
155{
156 // Preserve the Python sub-interpreter across restarts to avoid the
157 // Py_EndInterpreter / Py_NewInterpreter cycle that crashes on Python 3.13.
158 StopEventSystem(false);
159 m_mainworker.m_notificationsystem.Register(this);
160
161 if (!m_bEnabled)
162 return;
163
164 RequestStart();
165 m_TaskQueue.RequestStart();
166
167 m_sql.GetPreferencesVar("SecStatus", m_SecStatus);
168
169 LoadEvents();
170 GetCurrentStates();
171 GetCurrentScenesGroups();
172 GetCurrentUserVariables();
173#ifdef ENABLE_PYTHON
174 Plugins::PythonEventsInitialize(szUserDataFolder);
175#endif
176
177 m_thread = std::make_shared<std::thread>([this] { Do_Work(); });
178 SetThreadName(m_thread->native_handle(), "EventSystem");
179 m_eventqueuethread = std::make_shared<std::thread>([this] { EventQueueThread(); });
180 SetThreadName(m_eventqueuethread->native_handle(), "EventSystemQueue");
181 m_szStartTime = TimeToString(&m_StartTime, TF_DateTime);
182}
183
184void CEventSystem::StopEventSystem(bool bDestroyPythonInterpreter /*= true*/)
185{

Callers 3

Cmd_PostSettingsMethod · 0.80
RestoreDatabaseMethod · 0.80
Do_WorkMethod · 0.80

Calls 6

PythonEventsInitializeFunction · 0.85
SetThreadNameFunction · 0.85
TimeToStringFunction · 0.85
RequestStartMethod · 0.80
GetPreferencesVarMethod · 0.80
RegisterMethod · 0.45

Tested by

no test coverage detected