diff options
-rw-r--r-- | ebin/rabbit_app.in | 1 | ||||
-rw-r--r-- | src/rabbit_persister.erl | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ebin/rabbit_app.in b/ebin/rabbit_app.in index aaffcc32..ad8e3549 100644 --- a/ebin/rabbit_app.in +++ b/ebin/rabbit_app.in @@ -19,6 +19,7 @@ {ssl_options, []}, {vm_memory_high_watermark, 0.4}, {persister_max_wrap_entries, 500}, + {persister_hibernate_after, 10000}, {default_user, <<"guest">>}, {default_pass, <<"guest">>}, {default_vhost, <<"/">>}, diff --git a/src/rabbit_persister.erl b/src/rabbit_persister.erl index 34b01922..dd987c21 100644 --- a/src/rabbit_persister.erl +++ b/src/rabbit_persister.erl @@ -49,8 +49,6 @@ -define(LOG_BUNDLE_DELAY, 5). -define(COMPLETE_BUNDLE_DELAY, 2). --define(HIBERNATE_AFTER, 10000). - -define(PERSISTER_LOG_FORMAT_VERSION, {2, 4}). -record(pstate, {log_handle, entry_count, deadline, @@ -305,7 +303,8 @@ compute_deadline(_TimerDelay, ExistingDeadline) -> ExistingDeadline. compute_timeout(infinity) -> - ?HIBERNATE_AFTER; + {ok, HibernateAfter} = application:get_env(persister_hibernate_after), + HibernateAfter; compute_timeout(Deadline) -> DeltaMilliSec = time_diff(Deadline, now()) * 1000.0, if |