Merge pull request #255 from zhklcf/ignore_sentinel_channel

feat(*):ignore sentinel channel
v4
Vinllen Chen 5 years ago committed by GitHub
commit e5e3b366b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/redis-shake/sync.go

@ -591,6 +591,7 @@ func (ds *dbSyncer) syncCommand(reader *bufio.Reader, target []string, auth_type
log.Infof("dbSyncer[%v] FlushEvent:IncrSyncStart\tId:%s\t", ds.id, conf.Options.Id)
for {
ignoresentinel:= false
ignorecmd := false
isselect = false
resp := redis.MustDecodeOpt(decoder)
@ -625,7 +626,10 @@ func (ds *dbSyncer) syncCommand(reader *bufio.Reader, target []string, auth_type
} else if filter.FilterCommands(scmd) {
ignorecmd = true
}
if bypass || ignorecmd {
if strings.EqualFold(scmd, "publish") && strings.EqualFold(string(argv[0]), "__sentinel__:hello"){
ignoresentinel = true
}
if bypass || ignorecmd || ignoresentinel{
ds.nbypass.Incr()
// ds.SyncStat.BypassCmdCount.Incr()
metric.GetMetric(ds.id).AddBypassCmdCount(ds.id, 1)

Loading…
Cancel
Save