diff options
| -rw-r--r-- | bitbake/lib/bb/tinfoil.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index 8978bb5261..91fbf1b13e 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | import logging | 10 | import logging |
| 11 | import os | 11 | import os |
| 12 | import sys | 12 | import sys |
| 13 | import time | ||
| 13 | import atexit | 14 | import atexit |
| 14 | import re | 15 | import re |
| 15 | from collections import OrderedDict, defaultdict | 16 | from collections import OrderedDict, defaultdict |
| @@ -729,6 +730,7 @@ class Tinfoil: | |||
| 729 | 730 | ||
| 730 | ret = self.run_command('buildTargets', targets, task) | 731 | ret = self.run_command('buildTargets', targets, task) |
| 731 | if handle_events: | 732 | if handle_events: |
| 733 | lastevent = time.time() | ||
| 732 | result = False | 734 | result = False |
| 733 | # Borrowed from knotty, instead somewhat hackily we use the helper | 735 | # Borrowed from knotty, instead somewhat hackily we use the helper |
| 734 | # as the object to store "shutdown" on | 736 | # as the object to store "shutdown" on |
| @@ -741,6 +743,7 @@ class Tinfoil: | |||
| 741 | try: | 743 | try: |
| 742 | event = self.wait_event(0.25) | 744 | event = self.wait_event(0.25) |
| 743 | if event: | 745 | if event: |
| 746 | lastevent = time.time() | ||
| 744 | if event_callback and event_callback(event): | 747 | if event_callback and event_callback(event): |
| 745 | continue | 748 | continue |
| 746 | if helper.eventHandler(event): | 749 | if helper.eventHandler(event): |
| @@ -785,10 +788,13 @@ class Tinfoil: | |||
| 785 | self.logger.error(str(event)) | 788 | self.logger.error(str(event)) |
| 786 | result = False | 789 | result = False |
| 787 | break | 790 | break |
| 788 | |||
| 789 | elif helper.shutdown > 1: | 791 | elif helper.shutdown > 1: |
| 790 | break | 792 | break |
| 791 | termfilter.updateFooter() | 793 | termfilter.updateFooter() |
| 794 | if time.time() > (lastevent + (3*60)): | ||
| 795 | if not self.run_command('ping', handle_events=False): | ||
| 796 | print("\nUnable to ping server and no events, closing down...\n") | ||
| 797 | return False | ||
| 792 | except KeyboardInterrupt: | 798 | except KeyboardInterrupt: |
| 793 | termfilter.clearFooter() | 799 | termfilter.clearFooter() |
| 794 | if helper.shutdown == 1: | 800 | if helper.shutdown == 1: |
