go-common/app/interface/openplatform/article/service/sentinel.go

23 lines
404 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package service
import (
"context"
"go-common/app/interface/openplatform/article/conf"
)
var _sentinel = &conf.Sentinel{
EnableSentinel: 1,
DurationSample: 100,
MonitorCountSample: 100,
MonitorRateSample: 100,
DebugSample: 100,
}
// Sentinel .
func (s *Service) Sentinel(c context.Context) *conf.Sentinel {
if s.c.Sentinel == nil {
return _sentinel
}
return s.c.Sentinel
}