Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable25] Increase the fair-use push limit to 1.000 users #35298

Merged
merged 1 commit into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/private/Notification/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public function isFairUseOfFreePushService(): bool {
* 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);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/Notification/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ public function testGetCount(): void {

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],
];
}

Expand Down