Prevent config reload after initial save.
This commit is contained in:
parent
f4d2dec628
commit
14e7c82512
6 changed files with 31 additions and 13 deletions
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <uv.h>
|
||||
|
@ -145,6 +146,19 @@ bool xmrig::ConfigLoader::reload(xmrig::IConfig *oldConfig, const char *json)
|
|||
}
|
||||
|
||||
|
||||
bool xmrig::ConfigLoader::watch(IConfig *config)
|
||||
{
|
||||
if (!config->isWatch()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(m_watcher == nullptr);
|
||||
|
||||
m_watcher = new xmrig::ConfigWatcher(config->fileName(), m_creator, m_listener);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
xmrig::IConfig *xmrig::ConfigLoader::load(Process *process, IConfigCreator *creator, IConfigListener *listener)
|
||||
{
|
||||
m_creator = creator;
|
||||
|
@ -192,10 +206,6 @@ xmrig::IConfig *xmrig::ConfigLoader::load(Process *process, IConfigCreator *crea
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (config->isWatch()) {
|
||||
m_watcher = new xmrig::ConfigWatcher(config->fileName(), creator, listener);
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue