From 80f2bbdb255c7dd663a41dc018809b18723bfd6f Mon Sep 17 00:00:00 2001 From: l5y <220195275+l5yth@users.noreply.github.com> Date: Sun, 12 Oct 2025 09:08:50 +0200 Subject: [PATCH] Adjust federation announcement cadence (#292) --- web/lib/potato_mesh/config.rb | 4 +++- web/spec/config_spec.rb | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 web/spec/config_spec.rb diff --git a/web/lib/potato_mesh/config.rb b/web/lib/potato_mesh/config.rb index f4a1a30..f6ab209 100644 --- a/web/lib/potato_mesh/config.rb +++ b/web/lib/potato_mesh/config.rb @@ -133,8 +133,10 @@ module PotatoMesh ["potatomesh.net"].freeze end + # @return [Integer] the number of seconds between federation announcement broadcasts. + # Eight hours provides three updates per day without creating unnecessary chatter. def federation_announcement_interval - 24 * 60 * 60 + 8 * 60 * 60 end def site_name diff --git a/web/spec/config_spec.rb b/web/spec/config_spec.rb new file mode 100644 index 0000000..73b5620 --- /dev/null +++ b/web/spec/config_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require "spec_helper" + +RSpec.describe PotatoMesh::Config do + describe ".federation_announcement_interval" do + it "returns eight hours in seconds" do + expect(described_class.federation_announcement_interval).to eq(8 * 60 * 60) + end + end +end