1
This commit is contained in:
parent
0de6e748f6
commit
83692803ab
16
dbpool.go
16
dbpool.go
@ -163,6 +163,7 @@ func (this *dbPool) LoopLoad(
|
||||
if idx > lastMaxIdx {
|
||||
lastMaxIdx = idx
|
||||
hasNewDdata = true
|
||||
GetSysLog().Info("%s hasNewData max_idx:%d", watchTable, lastMaxIdx)
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -174,6 +175,21 @@ func (this *dbPool) LoopLoad(
|
||||
}
|
||||
}()
|
||||
|
||||
go func () {
|
||||
var waitSecond int64 = 10
|
||||
for {
|
||||
select {
|
||||
case waitSecond = <-chTimer:
|
||||
if waitSecond < 10 {
|
||||
waitSecond = 10
|
||||
}
|
||||
case <-time.After(time.Second * time.Duration(waitSecond)):
|
||||
waitSecond = 10
|
||||
newDataCond.Broadcast()
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
{
|
||||
var lastIdx int64
|
||||
for true {
|
||||
|
Loading…
x
Reference in New Issue
Block a user