mochengqian commented on code in PR #963:
URL: https://github.com/apache/dubbo-go-pixiu/pull/963#discussion_r3371610041


##########
pkg/filter/llm/proxy/filter.go:
##########
@@ -157,9 +164,11 @@ func (p *Plugin) Kind() string {
        return Kind
 }
 
-// CreateFilterFactory creates a new factory instance for this filter.
+// CreateFilterFactory creates a new factory instance for this filter. The
+// plugin-owned cooldown store is injected here so every factory and the
+// request executors it builds share one explicit store with no global 
fallback.
 func (p *Plugin) CreateFilterFactory() (filter.HttpFilterFactory, error) {
-       return &FilterFactory{cfg: &Config{}}, nil
+       return &FilterFactory{cfg: &Config{}, cooldowns: p.cooldowns}, nil
 }

Review Comment:
   CreateFilterFactory now calls p.cooldownStore() instead of directly 
accessing p.cooldowns. This ensures zero-value Plugin construction (&Plugin{}) 
safely initializes the store on first use, upholding the "non-nil store" 
contract without requiring callers to use newPlugin().



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to