Add API rebind polling

This commit is contained in:
Tony Butler 2021-12-22 05:17:08 -07:00
parent 02d45834e1
commit 548fbb9f71
4 changed files with 20 additions and 0 deletions

View file

@ -123,6 +123,20 @@ void xmrig::Api::stop()
}
void xmrig::Api::tick()
{
# ifdef XMRIG_FEATURE_HTTP
if (!m_base->config()->http().isEnabled() || m_httpd->isBound()) {
return;
}
if (++m_ticks % 10 == 0) {
m_ticks = 0;
m_httpd->start();
}
# endif
}
void xmrig::Api::onConfigChanged(Config *config, Config *previousConfig)
{
if (config->apiId() != previousConfig->apiId()) {