mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-20 09:26:37 +00:00
New config option: server.config_reload_interval_ms
This commit is contained in:
parent
2716228074
commit
d022bbdf27
@ -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
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
2
serval.h
2
serval.h
@ -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;
|
||||
|
4
server.c
4
server.c
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user