Run submission in a separate thread, and more explicit state

Also more explicit timeouts and an overall better handling of errors.
This commit is contained in:
2018-08-14 16:36:43 +02:00
parent 5d86b87f40
commit b64577df2e
8 changed files with 191 additions and 66 deletions

View File

@@ -1,9 +1,18 @@
import enum
import threading
import typing
class G:
"""Global state of the Benchmark Client."""
class State(enum.Enum):
welcome = 1
running = 2
complete = 3
submitting = 4
state = State.welcome
result_platform = ''
progress_status = ''
result_stats = ''
@@ -15,6 +24,7 @@ class G:
cached_system_info = {}
cached_compute_devices = []
results_submitted = False
results_url = ''
images = {}
current_progress = 0.0
@@ -25,6 +35,7 @@ class G:
@classmethod
def reset(cls):
"""Reset the global state."""
cls.state = G.State.welcome
cls.result_platform = ''
cls.progress_status = ''
cls.result_stats = ''
@@ -32,4 +43,5 @@ class G:
cls.background_image_path = ""
cls.scene_status = {}
cls.results_submitted = False
cls.results_url = ''
cls.submission_exception = None