From d1f2e5e967884e148e2480e470d6886977c5941e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 18 Nov 2022 14:44:41 +0100 Subject: [PATCH] Increase the fair-use push limit to 1.000 users Signed-off-by: Joas Schilling --- lib/private/Notification/Manager.php | 2 +- tests/lib/Notification/ManagerTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php index d758cae428f..3d77f643d93 100644 --- a/lib/private/Notification/Manager.php +++ b/lib/private/Notification/Manager.php @@ -305,7 +305,7 @@ class Manager implements IManager { * users overload our infrastructure. For this reason we have to rate-limit the * use of push notifications. If you need this feature, consider using Nextcloud Enterprise. */ - $isFairUse = $this->subscription->delegateHasValidSubscription() || $this->userManager->countSeenUsers() < 500; + $isFairUse = $this->subscription->delegateHasValidSubscription() || $this->userManager->countSeenUsers() < 1000; $pushAllowed = $isFairUse ? 'yes' : 'no'; $this->cache->set('push_fair_use', $pushAllowed, 3600); } diff --git a/tests/lib/Notification/ManagerTest.php b/tests/lib/Notification/ManagerTest.php index e482ba3876b..a32eebcdb95 100644 --- a/tests/lib/Notification/ManagerTest.php +++ b/tests/lib/Notification/ManagerTest.php @@ -248,10 +248,10 @@ class ManagerTest extends TestCase { public function dataIsFairUseOfFreePushService(): array { return [ - [true, 499, true], - [true, 500, true], - [false, 499, true], - [false, 500, false], + [true, 999, true], + [true, 1000, true], + [false, 999, true], + [false, 1000, false], ]; } -- 2.39.5