ddl: speed up aysc ddl event notify for test. (#3233)

This commit is contained in:
Han Fei
2017-05-11 12:39:24 +08:00
committed by GitHub
parent b0f66edfef
commit b69690cdc1

View File

@ -190,6 +190,14 @@ func (d *ddl) RegisterEventCh(ch chan<- *Event) {
// give up notify and log it.
func (d *ddl) asyncNotifyEvent(e *Event) {
if d.ddlEventCh != nil {
if d.lease == 0 {
// If lease is 0, it's always used in test.
select {
case d.ddlEventCh <- e:
default:
}
return
}
for i := 0; i < 10; i++ {
select {
case d.ddlEventCh <- e: