Skip to content
Snippets Groups Projects
Unverified Commit 41850629 authored by wangxw's avatar wangxw Committed by GitHub
Browse files

graceful shutdwon filter (#1585)


Co-authored-by: default avatarwangxiaowei14227 <wangxiaowei14227@autohome.com.cn>
parent 3182c7ad
No related branches found
No related tags found
No related merge requests found
......@@ -33,11 +33,13 @@ import (
func init() {
// `init()` is performed before config.Load(), so shutdownConfig will be retrieved after config was loaded.
var csf = &Filter{}
var psf = &Filter{}
extension.SetFilter(constant.GracefulShutdownConsumerFilterKey, func() filter.Filter {
return &Filter{}
return csf
})
extension.SetFilter(constant.GracefulShutdownProviderFilterKey, func() filter.Filter {
return &Filter{}
return psf
})
}
......@@ -69,7 +71,7 @@ func (f *Filter) OnResponse(ctx context.Context, result protocol.Result, invoker
func (f *Filter) Set(name string, conf interface{}) {
switch name {
case constant.GracefulShutdownFilterShutdownConfig:
if shutdownConfig, ok := conf.(*config.ShutdownConfig); !ok {
if shutdownConfig, ok := conf.(*config.ShutdownConfig); ok {
f.shutdownConfig = shutdownConfig
return
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment