Commit 20fb4b74 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Refactor `period_match?` to reuse `task`

parent 60a22a59
...@@ -76,13 +76,13 @@ module Geo ...@@ -76,13 +76,13 @@ module Geo
:gc :gc
elsif syncs_since_gc % full_repack_period == 0 elsif syncs_since_gc % full_repack_period == 0
:full_repack :full_repack
else elsif syncs_since_gc % repack_period == 0
:incremental_repack :incremental_repack
end end
end end
def period_match? def period_match?
[gc_period, full_repack_period, repack_period].any? { |period| syncs_since_gc % period == 0 } task.present?
end end
def housekeeping_enabled? def housekeeping_enabled?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment