(build)
| 678 | } |
| 679 | |
| 680 | async function estimateBuildDuration (build) { |
| 681 | let haveMissing = false; |
| 682 | let totalEstimate = 0; |
| 683 | for (let i = 0; i < build.tasks.length; i++) { |
| 684 | const task = build.tasks[i]; |
| 685 | const stat = await getObject('task_stat', task.name); |
| 686 | if (stat && stat.total) { |
| 687 | task.estimateDuration = stat.total / stat.items.length; |
| 688 | totalEstimate += task.estimateDuration; |
| 689 | } else { |
| 690 | haveMissing = true; |
| 691 | } |
| 692 | } |
| 693 | if (!haveMissing) { |
| 694 | build.estimateDuration = totalEstimate; |
| 695 | } |
| 696 | } |
| 697 | |
| 698 | async function killTask (task) { |
| 699 | setTimeout(async () => { |
no test coverage detected