From a1496e54156174dc1ec28f29ea3890c6ecb4be4e Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 7 Feb 2019 22:59:50 +0000 Subject: Check that a `check_run` actually started before it finished (github) --- modules/github/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/github/__init__.py') diff --git a/modules/github/__init__.py b/modules/github/__init__.py index a7f0f1ca..7dcdef90 100644 --- a/modules/github/__init__.py +++ b/modules/github/__init__.py @@ -554,8 +554,9 @@ class Module(ModuleManager.BaseModule): if data["check_run"]["completed_at"]: started_at = self._iso8601(data["check_run"]["started_at"]) completed_at = self._iso8601(data["check_run"]["completed_at"]) - seconds = (completed_at-started_at).total_seconds() - duration = " in %s" % utils.to_pretty_time(seconds) + if completed_at > started_at: + seconds = (completed_at-started_at).total_seconds() + duration = " in %s" % utils.to_pretty_time(seconds) status = data["check_run"]["status"] status_str = "" -- cgit v1.3.1-10-gc9f91