support for include directive in config parser

This commit is contained in:
Jeremy Zawodny 2010-03-19 22:24:17 -07:00
parent aa42c9a791
commit b3f83f1272
2 changed files with 12 additions and 0 deletions

View File

@ -1701,6 +1701,8 @@ static void loadServerConfig(char *filename) {
if (server.dbnum < 1) {
err = "Invalid number of databases"; goto loaderr;
}
} else if (!strcasecmp(argv[0],"include") && argc == 2) {
loadServerConfig(argv[1]);
} else if (!strcasecmp(argv[0],"maxclients") && argc == 2) {
server.maxclients = atoi(argv[1]);
} else if (!strcasecmp(argv[0],"maxmemory") && argc == 2) {

View File

@ -278,3 +278,13 @@ shareobjectspoolsize 1024
# configuration directives.
hash-max-zipmap-entries 64
hash-max-zipmap-value 512
################################## INCLUDES ###################################
# Include one or more other config files here. This is useful if you
# have a standard template that goes to all redis server but also need
# to customize a few per-server settings. Include files can include
# other files, so use this wisely.
#
# include /path/to/local.conf
# include /path/to/other.conf