Add 'rhizome.clean_on_open' config option

This commit is contained in:
Andrew Bettison 2013-02-20 14:43:20 +10:30
parent 8f707f4cdb
commit cf13a4b51e
2 changed files with 3 additions and 2 deletions

View File

@ -302,6 +302,7 @@ END_STRUCT
STRUCT(rhizome)
ATOM(int, enable, 1, cf_opt_int_boolean,, "If true, server opens Rhizome database when starting")
ATOM(int, clean_on_open, 1, cf_opt_int_boolean,, "If true, Rhizome database is cleaned at start of every command")
STRING(256, datastore_path, "", cf_opt_absolute_path,, "Path of rhizome storage directory, absolute or relative to instance directory")
ATOM(uint64_t, database_size, 1000000, cf_opt_uint64_scaled,, "Size of database in bytes")
ATOM(uint32_t, fetch_delay_ms, 50, cf_opt_uint32_nonzero,, "Delay from receiving first bundle advert to initiating fetch")

View File

@ -295,8 +295,8 @@ int rhizome_opendb()
All changes should attempt to preserve any existing data */
// We can't delete a file that is being transferred in another process at this very moment...
// TODO don't cleanup before every command line operation...
rhizome_cleanup();
if (config.rhizome.clean_on_open)
rhizome_cleanup();
RETURN(0);
}