diff --git a/docs/stellar-core_example.cfg b/docs/stellar-core_example.cfg index edc0680f90..b0952d150d 100644 --- a/docs/stellar-core_example.cfg +++ b/docs/stellar-core_example.cfg @@ -238,13 +238,13 @@ CATCHUP_RECENT=1024 # This limits the number that will be active at a time. MAX_CONCURRENT_SUBPROCESSES=10 -# AUTOMATIC_MAINTENANCE_PERIOD (integer, seconds) default 3600 +# AUTOMATIC_MAINTENANCE_PERIOD (integer, seconds) default 14400 # Interval between automatic maintenance executions # Set to 0 to disable automatic maintenance -AUTOMATIC_MAINTENANCE_PERIOD=3600 +AUTOMATIC_MAINTENANCE_PERIOD=14400 # AUTOMATIC_MAINTENANCE_COUNT (integer) default 50000 -# Number of unneeded rows in each table that will be removed during one +# Number of unneeded ledgers in each table that will be removed during one # maintenance run. # Set to 0 to disable automatic maintenance AUTOMATIC_MAINTENANCE_COUNT=5000 diff --git a/src/main/Config.cpp b/src/main/Config.cpp index 9b490e55da..f9b96b4904 100644 --- a/src/main/Config.cpp +++ b/src/main/Config.cpp @@ -42,7 +42,7 @@ Config::Config() : NODE_SEED(SecretKey::random()) MANUAL_CLOSE = false; CATCHUP_COMPLETE = false; CATCHUP_RECENT = 0; - AUTOMATIC_MAINTENANCE_PERIOD = std::chrono::seconds{3600}; + AUTOMATIC_MAINTENANCE_PERIOD = std::chrono::seconds{14400}; AUTOMATIC_MAINTENANCE_COUNT = 50000; ARTIFICIALLY_GENERATE_LOAD_FOR_TESTING = false; ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING = false; diff --git a/src/main/Maintainer.cpp b/src/main/Maintainer.cpp index 5ffe241d09..d3c6a95374 100644 --- a/src/main/Maintainer.cpp +++ b/src/main/Maintainer.cpp @@ -17,9 +17,12 @@ Maintainer::Maintainer(Application& app) : mApp{app}, mTimer{mApp} void Maintainer::start() { - if (mApp.getConfig().AUTOMATIC_MAINTENANCE_PERIOD.count() > 0 && - mApp.getConfig().AUTOMATIC_MAINTENANCE_COUNT > 0) + auto& c = mApp.getConfig(); + if (c.AUTOMATIC_MAINTENANCE_PERIOD.count() > 0 && + c.AUTOMATIC_MAINTENANCE_COUNT > 0) + { scheduleMaintenance(); + } } void