restore TimeoutChan

This commit is contained in:
Kamil Dziedzic
2017-10-14 18:44:46 +02:00
parent c2fd98d35b
commit c67354443c

View File

@@ -18,6 +18,7 @@ var (
type Profiler interface {
GetLastError() error
QueriesChan() chan stats.Queries
TimeoutsChan() <-chan time.Time
FlushQueries()
Start()
Stop()
@@ -93,6 +94,15 @@ func (p *Profile) Stop() {
}
}
func (p *Profile) TimeoutsChan() <-chan time.Time {
p.lock.Lock()
defer p.lock.Unlock()
if p.timeoutsChan == nil {
p.timeoutsChan = make(chan time.Time)
}
return p.timeoutsChan
}
func (p *Profile) getData() {
go p.getDocs()
p.stopWaitGroup.Add(1)