File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -273,12 +273,13 @@ export default class RichEditorPlugin extends AdminForthPlugin {
273273
274274 if ( this . options . completion . rateLimit ?. limit ) {
275275 // rate limit
276- const { error } = RateLimiter . checkRateLimit (
277- this . pluginInstanceId ,
278- this . options . completion . rateLimit ?. limit ,
279- this . adminforth . auth . getClientIp ( headers ) ,
280- ) ;
281- if ( error ) {
276+ // const { error } = RateLimiter.checkRateLimit(
277+ // this.pluginInstanceId,
278+ // this.options.completion.rateLimit?.limit,
279+ // this.adminforth.auth.getClientIp(headers),
280+ // );
281+ const rateLimiter = new RateLimiter ( this . options . completion . rateLimit ?. limit ) ;
282+ if ( ! rateLimiter . consume ( `${ this . pluginInstanceId } -${ this . adminforth . auth . getClientIp ( headers ) } ` ) ) {
282283 return {
283284 completion : [ ] ,
284285 }
You can’t perform that action at this time.
0 commit comments