1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 01:16:14 +01:00

buildhist: Do not traceback on missing duration

This commit is contained in:
Daniel Mach 2023-01-26 15:49:40 +01:00
parent d24e98b212
commit 428dd23bf4

View File

@ -47,8 +47,13 @@ class BuildHistory:
"ver_rel": node.get("versrel"),
"build_count": int(node.get("bcnt")),
"time": time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(int(node.get("time")))),
"duration": int(node.get("duration")),
}
# duration may not always be available
duration = node.get("duration")
if duration:
item["duration"] = int(duration)
result.append(item)
return result
@ -72,7 +77,7 @@ class BuildHistory:
i["srcmd5"],
f"{i['ver_rel']}.{i['build_count']}",
i["rev"],
i["duration"],
i.get("duration", ""),
)
data.extend(item)