Merge "Check start time for wait_time key" into feature/zuulv3
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index 8db9e46..73fa923 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -374,9 +374,10 @@
self.statsd.incr(key)
# zuul.tenant.<tenant>.pipeline.<pipeline>.project.
# <host>.<project>.<branch>.job.<job>.wait_time
- key = '%s.wait_time' % jobkey
- dt = int((build.start_time - build.execute_time) * 1000)
- self.statsd.timing(key, dt)
+ if build.start_time:
+ key = '%s.wait_time' % jobkey
+ dt = int((build.start_time - build.execute_time) * 1000)
+ self.statsd.timing(key, dt)
except Exception:
self.log.exception("Exception reporting runtime stats")
event = BuildCompletedEvent(build)