Add optionally-include configuration directive.
This commit is contained in:
@@ -45,6 +45,8 @@ load-on-startup
|
||||
even if they exist. This is useful on slaves that would immediately need
|
||||
to replicate from masters anyway.
|
||||
|
||||
optionally-include
|
||||
Works like 'include' but silently ignores non-existing files.
|
||||
|
||||
Additional Statistics
|
||||
---------------------
|
||||
|
||||
@@ -549,3 +549,5 @@ client-output-buffer-limit pubsub 32mb 8mb 60
|
||||
#
|
||||
# include /path/to/local.conf
|
||||
# include /path/to/other.conf
|
||||
# optionally-include /path/to/optional-file.conf
|
||||
|
||||
|
||||
@@ -184,6 +184,12 @@ void loadServerConfigFromString(char *config) {
|
||||
}
|
||||
} else if (!strcasecmp(argv[0],"include") && argc == 2) {
|
||||
loadServerConfig(argv[1],NULL);
|
||||
} else if (!strcasecmp(argv[0],"optionally-include") && argc == 2) {
|
||||
FILE *tmp = fopen(argv[1], "r");
|
||||
if (tmp != NULL) {
|
||||
fclose(tmp);
|
||||
loadServerConfig(argv[1],NULL);
|
||||
}
|
||||
} else if (!strcasecmp(argv[0],"maxclients") && argc == 2) {
|
||||
server.maxclients = atoi(argv[1]);
|
||||
if (server.maxclients < 1) {
|
||||
|
||||
Reference in New Issue
Block a user