Skip to content

Commit

Permalink
Update rate limits, fixes #4537
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Jul 14, 2023
1 parent 9233cd8 commit 1cc6274
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/Api/ApiV1Controller.php
Expand Up @@ -1621,7 +1621,7 @@ public function mediaUpload(Request $request)
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();

return $dailyLimit >= 250;
return $dailyLimit >= 1250;
});
abort_if($limitReached == true, 429);

Expand Down Expand Up @@ -1826,7 +1826,7 @@ public function mediaUploadV2(Request $request)
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();

return $dailyLimit >= 250;
return $dailyLimit >= 1250;
});
abort_if($limitReached == true, 429);

Expand Down Expand Up @@ -2838,7 +2838,7 @@ public function statusCreate(Request $request)
->where('created_at', '>', now()->subDays(1))
->count();

return $dailyLimit >= 100;
return $dailyLimit >= 1000;
});

abort_if($limitReached == true, 429);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/ApiV2Controller.php
Expand Up @@ -225,7 +225,7 @@ public function mediaUploadV2(Request $request)
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();

return $dailyLimit >= 250;
return $dailyLimit >= 1250;
});
abort_if($limitReached == true, 429);

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/ComposeController.php
Expand Up @@ -98,7 +98,7 @@ public function mediaUpload(Request $request)
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();

return $dailyLimit >= 250;
return $dailyLimit >= 1250;
});

abort_if($limitReached == true, 429);
Expand Down Expand Up @@ -190,7 +190,7 @@ public function mediaUpdate(Request $request)
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();

return $dailyLimit >= 500;
return $dailyLimit >= 1500;
});

abort_if($limitReached == true, 429);
Expand Down Expand Up @@ -499,7 +499,7 @@ public function store(Request $request)
->where('created_at', '>', now()->subDays(1))
->count();

return $dailyLimit >= 100;
return $dailyLimit >= 1000;
});

abort_if($limitReached == true, 429);
Expand Down

0 comments on commit 1cc6274

Please sign in to comment.