Add "autosave" config option.

This commit is contained in:
XMRig 2018-09-27 19:07:04 +03:00
parent a63677e255
commit 143da8380e
8 changed files with 36 additions and 13 deletions

View file

@ -67,6 +67,7 @@ xmrig::CommonConfig::CommonConfig() :
m_adjusted(false),
m_apiIPv6(false),
m_apiRestricted(true),
m_autoSave(true),
m_background(false),
m_colors(true),
m_dryRun(false),
@ -217,7 +218,7 @@ bool xmrig::CommonConfig::save()
rapidjson::PrettyWriter<rapidjson::FileWriteStream> writer(os);
doc.Accept(writer);
fclose(fp);
fflush(fp);
uv_fs_close(uv_default_loop(), &req, fd, nullptr);
uv_fs_req_cleanup(&req);
@ -308,10 +309,14 @@ bool xmrig::CommonConfig::parseBoolean(int key, bool enable)
m_apiRestricted = enable;
break;
case IConfig::DryRunKey: /* --dry-run */
case DryRunKey: /* --dry-run */
m_dryRun = enable;
break;
case AutoSaveKey:
m_autoSave = enable;
break;
default:
break;
}