mirror of https://github.com/ledisdb/ledisdb.git
elimination exec in new goroutine
check whether cog cpu is still very high
This commit is contained in:
parent
0fd6c150e8
commit
ca8c4e931d
|
@ -165,12 +165,17 @@ func (l *Ledis) activeExpireCycle() {
|
||||||
go func() {
|
go func() {
|
||||||
tick := time.NewTicker(1 * time.Second)
|
tick := time.NewTicker(1 * time.Second)
|
||||||
end := false
|
end := false
|
||||||
|
done := make(chan struct{})
|
||||||
for !end {
|
for !end {
|
||||||
select {
|
select {
|
||||||
case <-tick.C:
|
case <-tick.C:
|
||||||
|
go func() {
|
||||||
for _, eli := range executors {
|
for _, eli := range executors {
|
||||||
eli.active()
|
eli.active()
|
||||||
}
|
}
|
||||||
|
done <- struct{}{}
|
||||||
|
}()
|
||||||
|
<-done
|
||||||
case <-l.quit:
|
case <-l.quit:
|
||||||
end = true
|
end = true
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue