Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

feat: Add adaptive post spacing to prevent feed floodingPost interval#486

Open
rmdes wants to merge 3 commits into
milanmdev:mainfrom
rmdes:post-interval
Open

feat: Add adaptive post spacing to prevent feed floodingPost interval#486
rmdes wants to merge 3 commits into
milanmdev:mainfrom
rmdes:post-interval

Conversation

@rmdes
Copy link
Copy Markdown

@rmdes rmdes commented Jan 11, 2026

Problem

When the queue has multiple posts (e.g., 10 items), they all publish within seconds, flooding followers' feeds.

Solution

Adds adaptive spacing that dynamically calculates delays between posts based on queue size.

New Configuration Options

Option Type Default Description
adaptiveSpacing boolean false Enable/disable adaptive spacing
spacingWindow number 600 Target time window (seconds) to spread the queue over
minSpacing number 1 Minimum delay between posts (seconds)
maxSpacing number 60 Maximum delay between posts (seconds)

How It Works

The delay between posts is calculated as: spacingWindow / queueSize, clamped between minSpacing and maxSpacing.

Example with defaults (spacingWindow: 600, minSpacing: 1, maxSpacing: 60):

Queue Size Calculated Delay Clamped Result
5 posts 120s 60s (capped at max)
10 posts 60s 60s
20 posts 30s 30s
100 posts 6s 6s
1000 posts 0.6s 1s (raised to min)

This means:

  • A 10-post queue with spacingWindow: 600 takes ~10 minutes to fully publish
  • A 100-post queue with the same settings also takes ~10 minutes (posts are closer together)

The minSpacing and maxSpacing bounds prevent edge cases: extremely long waits for small queues, or spam-like bursts for huge queues.

rmdes added 3 commits January 11, 2026 17:49
 reamaining 1 Including the just-posted item in the calculation ensures the spacing window accounts for all posts in the sequence, which is especially important for small queues where the difference between dividing by 2 versus 3 significantly affects the delay.
@rmdes
Copy link
Copy Markdown
Author

rmdes commented Jan 11, 2026

@milanmdev Alright, I think this is now better and clear, let me know what you think, i'm already testing this since several months and it works really well

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant