Switching a time.Now().Sub() to time.Since()

This commit is contained in:
Alain Jobart 2015-04-20 07:19:45 -07:00
Родитель 4e83c96cd2
Коммит c23ec88a9e
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -258,7 +258,7 @@ func (agent *ActionAgent) Healthy() (time.Duration, error) {
healthy := agent._healthy
if healthy == nil {
timeSinceLastCheck := time.Now().Sub(agent._healthyTime)
timeSinceLastCheck := time.Since(agent._healthyTime)
if timeSinceLastCheck > *healthCheckInterval*3 {
healthy = fmt.Errorf("last health check is too old: %s > %s", timeSinceLastCheck, *healthCheckInterval*3)
}