New config option: server.config_reload_interval_ms

This commit is contained in:
Andrew Bettison 2014-04-16 18:24:16 +09:30
parent 2716228074
commit d022bbdf27
4 changed files with 4 additions and 5 deletions

View File

@ -330,6 +330,7 @@ STRUCT(server)
STRING(256, chdir, "/", absolute_path,, "Absolute path of chdir(2) for server process")
STRING(256, interface_path, "", str_nonempty,, "Path of directory containing interface files, either absolute or relative to instance directory")
ATOM(bool_t, respawn_on_crash, 0, boolean,, "If true, server will exec(2) itself on fatal signals, eg SEGV")
ATOM(uint32_t, config_reload_interval_ms, 1000, uint32_nonzero,, "Time interval between configuration reload polls, in milliseconds")
SUB_STRUCT(watchdog, watchdog,)
END_STRUCT

View File

@ -126,7 +126,7 @@ int overlayServerMode()
SCHEDULE(server_shutdown_check, 0, 100);
/* Periodically reload configuration */
SCHEDULE(server_config_reload, SERVER_CONFIG_RELOAD_INTERVAL_MS, SERVER_CONFIG_RELOAD_INTERVAL_MS + 100);
SCHEDULE(server_config_reload, config.server.config_reload_interval_ms, 100);
overlay_mdp_bind_internal_services();

View File

@ -196,8 +196,6 @@ int strn_to_sid_t(sid_t *sid, const char *hex, const char **endp);
#define alloca_tohex_sas(sas) alloca_tohex((sas), SAS_SIZE)
#define SERVER_CONFIG_RELOAD_INTERVAL_MS 1000
struct cli_parsed;
extern int servalShutdown;

View File

@ -219,8 +219,8 @@ void server_config_reload(struct sched_ent *alarm)
}
if (alarm) {
time_ms_t now = gettime_ms();
alarm->alarm = now + SERVER_CONFIG_RELOAD_INTERVAL_MS;
alarm->deadline = alarm->alarm + 1000;
alarm->alarm = now + config.server.config_reload_interval_ms;
alarm->deadline = alarm->alarm + 100;
schedule(alarm);
}
}