|
|
int const | TIME_WINDOW = HOURSECS |
| | TIME_WINDOW Time window in seconds (1 hour).
|
| |
◆ __construct()
Constructor.
- Parameters
-
| ClockInterface | $clock | Clock instance for time management. |
- Parameters
-
| $clock | Clock instance for time management. |
◆ check_global_rate_limit()
| core_ai\rate_limiter::check_global_rate_limit |
( |
string | $component, |
|
|
int | $ratelimit ) |
Check global rate limit for a component.
- Parameters
-
| string | $component | Name of the component. |
| int | $ratelimit | Number of requests per time window. |
- Return values
-
| bool | True if request is allowed, false otherwise. |
◆ check_user_rate_limit()
| core_ai\rate_limiter::check_user_rate_limit |
( |
string | $component, |
|
|
int | $ratelimit, |
|
|
int | $userid ) |
Check user rate limit for a component.
- Parameters
-
| string | $component | Name of the component. |
| int | $ratelimit | Number of requests per time window. |
| int | $userid | User ID for user-specific rate limit. |
- Return values
-
| bool | True if request is allowed, false otherwise. |
The documentation for this class was generated from the following file:
- ai/classes/rate_limiter.php