File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ export default class UploadPlugin extends AdminForthPlugin {
2525 // for calcualting average time
2626 this . totalCalls = 0 ;
2727 this . totalDuration = 0 ;
28+ if ( this . options . generation ?. rateLimit ?. limit ) {
2829 this . rateLimiter = new RateLimiter ( this . options . generation . rateLimit ?. limit )
30+ }
2931 }
3032
3133 instanceUniqueRepresentation ( pluginOptions : any ) : string {
@@ -347,7 +349,7 @@ export default class UploadPlugin extends AdminForthPlugin {
347349 path : `/plugin/${ this . pluginInstanceId } /generate_images` ,
348350 handler : async ( { body, adminUser, headers } ) => {
349351 const { prompt, recordId } = body ;
350- if ( this . options . generation . rateLimit ?. limit ) {
352+ if ( this . rateLimiter ) {
351353 // rate limit
352354 // const { error } = RateLimiter.checkRateLimit(
353355 // this.pluginInstanceId,
You can’t perform that action at this time.
0 commit comments