build: make per-build hard time limit customizable

Add "timeout=n" metadata field that overrides build timeout (in seconds).
The default is 7200, i.e. 2 hours.
This commit is contained in:
relan 2018-01-28 09:56:19 +03:00
parent cc4b57b10b
commit 86f34ee70a
6 changed files with 122 additions and 4 deletions

View file

@ -206,6 +206,7 @@ def fieldtype(name):
build_flags_order = [
'disable',
'commit',
'timeout',
'subdir',
'submodules',
'sudo',
@ -248,6 +249,7 @@ class Build(dict):
super().__init__()
self.disable = False
self.commit = None
self.timeout = None
self.subdir = None
self.submodules = False
self.sudo = ''
@ -347,6 +349,7 @@ flagtypes = {
'forcevercode': TYPE_BOOL,
'novcheck': TYPE_BOOL,
'antifeatures': TYPE_LIST,
'timeout': TYPE_INT,
}
@ -1208,6 +1211,8 @@ def parse_txt_metadata(mf, app):
build[pk] = pv
elif t == TYPE_BOOL:
build[pk] = _decode_bool(pv)
elif t == TYPE_INT:
build[pk] = int(pv)
def parse_buildline(lines):
v = "".join(lines)