Enhancements

Refresh cron schedule after loading TOML preferences (#629).
Keep line order of Plugin section in Loon configs.
This commit is contained in:
Tindy X 2023-10-08 02:57:56 +08:00
parent c3e8e88fb6
commit 3cb07c3325
No known key found for this signature in database
GPG Key ID: CD068E6DB6C55A1C
2 changed files with 2 additions and 0 deletions

View File

@ -1768,6 +1768,7 @@ std::string proxyToLoon(std::vector<Proxy> &nodes, const std::string &base_conf,
string_array remarks_list;
ini.store_any_line = true;
ini.add_direct_save_section("Plugin");
if(ini.parse(base_conf) != INIREADER_EXCEPTION_NONE && !ext.nodelist)
{
writeLog(0, "Loon base loader failed with error: " + ini.get_last_error(), LOG_LEVEL_ERROR);

View File

@ -718,6 +718,7 @@ void readTOMLConf(toml::value &root)
auto tasks = toml::find_or<std::vector<toml::value>>(root, "tasks", {});
importItems(tasks, "tasks", false);
global.cronTasks = toml::get<CronTaskConfigs>(toml::value(tasks));
refresh_schedule();
const auto &section_server = toml::find(root, "server");