This commit is contained in:
parent
df60ac8dfc
commit
db51ec6489
@ -618,6 +618,18 @@ template <> struct adl_serializer<std::atomic<repertory::database_type>> {
|
|||||||
value.store(repertory::database_type_from_string(data.get<std::string>()));
|
value.store(repertory::database_type_from_string(data.get<std::string>()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <> struct adl_serializer<std::atomic<repertory::download_type>> {
|
||||||
|
static void to_json(json &data,
|
||||||
|
const std::atomic<repertory::download_type> &value) {
|
||||||
|
data = repertory::download_type_to_string(value.load());
|
||||||
|
}
|
||||||
|
|
||||||
|
static void from_json(const json &data,
|
||||||
|
std::atomic<repertory::download_type> &value) {
|
||||||
|
value.store(repertory::download_type_from_string(data.get<std::string>()));
|
||||||
|
}
|
||||||
|
};
|
||||||
NLOHMANN_JSON_NAMESPACE_END
|
NLOHMANN_JSON_NAMESPACE_END
|
||||||
|
|
||||||
#endif // REPERTORY_INCLUDE_TYPES_REPERTORY_HPP_
|
#endif // REPERTORY_INCLUDE_TYPES_REPERTORY_HPP_
|
||||||
|
@ -91,11 +91,11 @@ app_config::app_config(const provider_type &prov,
|
|||||||
auto host_cfg = get_host_config();
|
auto host_cfg = get_host_config();
|
||||||
host_cfg.agent_string = default_agent_name(prov_);
|
host_cfg.agent_string = default_agent_name(prov_);
|
||||||
host_cfg.api_port = default_api_port(prov_);
|
host_cfg.api_port = default_api_port(prov_);
|
||||||
set_host_config(host_cfg);
|
host_config_ = host_cfg;
|
||||||
|
|
||||||
auto rm_cfg = get_remote_mount();
|
auto rm_cfg = get_remote_mount();
|
||||||
rm_cfg.api_port = default_remote_api_port(prov);
|
rm_cfg.api_port = default_remote_api_port(prov);
|
||||||
set_remote_mount(rm_cfg);
|
remote_mount_ = rm_cfg;
|
||||||
|
|
||||||
if (not utils::file::directory(data_directory_).create_directory()) {
|
if (not utils::file::directory(data_directory_).create_directory()) {
|
||||||
throw startup_exception(
|
throw startup_exception(
|
||||||
@ -1239,7 +1239,6 @@ void app_config::set_sia_config(sia_config value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void app_config::set_task_wait_ms(std::uint16_t value) {
|
void app_config::set_task_wait_ms(std::uint16_t value) {
|
||||||
std::cout << task_wait_ms_.load() << '|' << value << std::endl;
|
|
||||||
set_value(task_wait_ms_, value);
|
set_value(task_wait_ms_, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1249,7 +1248,6 @@ auto app_config::set_value(dest &dst, const source &src) -> bool {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "changed" << std::endl;
|
|
||||||
dst = src;
|
dst = src;
|
||||||
config_changed_ = true;
|
config_changed_ = true;
|
||||||
save();
|
save();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user