mirror of
https://github.com/cydrobolt/polr.git
synced 2024-09-19 15:11:40 +02:00
Merge branch 'patch-1' of https://github.com/iurisilvio/polr into iurisilvio-api_quota_index
This commit is contained in:
commit
216f0c75c0
@ -23,11 +23,15 @@ class ApiHelper {
|
||||
$api_quota = env('SETTING_ANON_API_QUOTA') ?: 5;
|
||||
}
|
||||
|
||||
if ($api_quota < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$links_last_minute = Link::where('is_api', 1)
|
||||
->where('creator', $username)
|
||||
->where('created_at', '>=', $last_minute)
|
||||
->count();
|
||||
|
||||
return ($api_quota > -1 && $links_last_minute >= $api_quota);
|
||||
return $links_last_minute >= $api_quota;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user