mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-09 16:52:40 -05:00
Add "autosave" config option.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
|
||||
inline bool isApiIPv6() const { return m_apiIPv6; }
|
||||
inline bool isApiRestricted() const { return m_apiRestricted; }
|
||||
inline bool isAutoSave() const { return m_autoSave; }
|
||||
inline bool isBackground() const { return m_background; }
|
||||
inline bool isColors() const { return m_colors; }
|
||||
inline bool isDryRun() const { return m_dryRun; }
|
||||
@@ -88,6 +89,7 @@ protected:
|
||||
bool m_adjusted;
|
||||
bool m_apiIPv6;
|
||||
bool m_apiRestricted;
|
||||
bool m_autoSave;
|
||||
bool m_background;
|
||||
bool m_colors;
|
||||
bool m_dryRun;
|
||||
|
||||
Reference in New Issue
Block a user