Don't attempt to read on the first iteration if we can't reasonably expect the write loop to have fired yet. Double the duration here to avoid a race.
(info *util.TraceInfo, now time.Time, startTime time.Time, writeBackoff time.Duration, longBackoff time.Duration)
| 297 | // expect the write loop to have fired yet. Double the duration here to |
| 298 | // avoid a race. |
| 299 | func traceIsReady(info *util.TraceInfo, now time.Time, startTime time.Time, writeBackoff time.Duration, longBackoff time.Duration) bool { |
| 300 | if info.Timestamp().Before(startTime.Add(2 * writeBackoff)) { |
| 301 | return false |
| 302 | } |
| 303 | |
| 304 | return info.Ready(now, writeBackoff, longBackoff) |
| 305 | } |
| 306 | |
| 307 | func doWrite(jaegerClient util.JaegerClient, tickerWrite *time.Ticker, interval time.Duration, config vultureConfiguration, l *zap.Logger) { |
| 308 | go func() { |