mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-11-10 14:44:04 +08:00
Write a topic's subscriber activity every one to two hours instead of every 30 to 60 minutes
Claude-Session: https://claude.ai/code/session_01DeXuhSjq5Gta5qPJgSceFe
This commit is contained in:
1 parent
3000245ad6
commit
858af8c6ad
3 files changed
+6
-6
No files matched your search
+1
-1
@@ -2345,7 +2345,7 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release
|
||||
|
||||
**Bug fixes + maintenance:**
|
||||
|
||||
* With `visitor-subscriber-rate-limiting` and a user database, write a UnifiedPush topic's subscriber activity about once an hour instead of every 5 minutes, spread over time, and not at all when a poll or reconnect only repeats the same subscriber; on ntfy.sh, v2.37.0's writes of ~45k topics every 5 minutes, all due in the same minute, slowed down the database ([#2151](https://github.com/binwiederhier/ntfy/pull/2151))
|
||||
* With `visitor-subscriber-rate-limiting` and a user database, write a UnifiedPush topic's subscriber activity every one to two hours instead of every 5 minutes, spread over time, and not at all when a poll or reconnect only repeats the same subscriber; on ntfy.sh, v2.37.0's writes of ~45k topics every 5 minutes, all due in the same minute, slowed down the database ([#2151](https://github.com/binwiederhier/ntfy/pull/2151))
|
||||
|
||||
### ntfy iOS app v1.8.0 (UNRELEASED)
|
||||
|
||||
|
||||
+4
-4
@@ -36,11 +36,11 @@ const (
|
||||
pruneAfter = 7 * 24 * time.Hour
|
||||
|
||||
// touchInterval is how often a touch moves a topic's subscriber activity at most, so an open
|
||||
// stream, touched by the manager every minute, writes about once an hour. Each topic has its own
|
||||
// interval between half of it and all of it (touchIntervalFor), so topics touched together,
|
||||
// like the streams that reconnect after a restart, are not written together again. Hourly is
|
||||
// stream, touched by the manager every minute, writes every one to two hours. Each topic has its
|
||||
// own interval between half of it and all of it (touchIntervalFor), so topics touched together,
|
||||
// like the streams that reconnect after a restart, are not written together again. Two hours is
|
||||
// plenty for the rate visitor's day (rateVisitorLiveFor) and the 410's four days.
|
||||
touchInterval = time.Hour
|
||||
touchInterval = 2 * time.Hour
|
||||
|
||||
// maxRefused caps the topics known only from refused pushes, so a push flood cannot fill memory;
|
||||
// rows read from other nodes count too, so it is effectively cluster-wide
|
||||
|
||||
@@ -101,7 +101,7 @@ func TestService_State_ReturnsCopy(t *testing.T) {
|
||||
|
||||
func TestService_Touch_Throttled(t *testing.T) {
|
||||
// A touch moves subscriber activity at most once per the topic's own touch interval, so an open
|
||||
// stream the manager touches every minute costs a write about once an hour only
|
||||
// stream the manager touches every minute costs a write every one to two hours only
|
||||
s, clock := newTestServiceWithClock(t)
|
||||
s.SetRateVisitor("upA", "", "1.2.3.4")
|
||||
set := clock.unix()
|
||||
|
||||
Reference in new issue
Block a user