Navigation Menu

Skip to content

Commit

Permalink
groonga: add --cache-base-path to use persistent cache
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 6, 2017
1 parent da33942 commit dafd707
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/groonga.c
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2009-2016 Brazil
Copyright(C) 2009-2017 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -3122,6 +3122,10 @@ show_usage(FILE *output)
" --default-request-timeout <timeout>:\n"
" specify the default request timeout in seconds\n"
" (default: %f)\n"
" --cache-base-path <path>: specify the cache base path\n"
" You can make cache persistent by this option\n"
" You must specify path on memory file system\n"
" (default: none; disabled)\n"
"\n"
"Memcached options:\n"
" --memcached-column <column>:\n"
Expand Down Expand Up @@ -3213,6 +3217,7 @@ main(int argc, char **argv)
const char *working_directory_arg = NULL;
const char *config_path = NULL;
const char *default_request_timeout_arg = NULL;
const char *cache_base_path = NULL;
int exit_code = EXIT_SUCCESS;
int i;
int flags = 0;
Expand Down Expand Up @@ -3254,6 +3259,7 @@ main(int argc, char **argv)
FLAG_USE_WINDOWS_EVENT_LOG, GETOPT_OP_ON},
{'\0', "memcached-column", NULL, 0, GETOPT_OP_NONE},
{'\0', "default-request-timeout", NULL, 0, GETOPT_OP_NONE},
{'\0', "cache-base-path", NULL, 0, GETOPT_OP_NONE},
{'\0', NULL, NULL, 0, 0}
};
opts[0].arg = &port_arg;
Expand All @@ -3279,6 +3285,7 @@ main(int argc, char **argv)
opts[27].arg = &working_directory_arg;
opts[29].arg = &memcached_column_name;
opts[30].arg = &default_request_timeout_arg;
opts[31].arg = &cache_base_path;

reset_ready_notify_pipe();

Expand Down Expand Up @@ -3322,6 +3329,10 @@ main(int argc, char **argv)
}
}

if (cache_base_path) {
grn_set_default_cache_base_path(cache_base_path);
}

/* ignore mode option in config file */
flags = (flags == ACTION_ERROR) ? 0 : (flags & ~ACTION_MASK);

Expand Down

0 comments on commit dafd707

Please sign in to comment.