- support offline mode
This commit is contained in:
@@ -66,12 +66,12 @@ class QualtestBackend:
|
||||
self.__phone = self.load_phone(cache)
|
||||
|
||||
|
||||
def upload_report(self, report, cache: InfoCache) -> (str, bool):
|
||||
def upload_report(self, report: dict, cache: InfoCache) -> (str, bool):
|
||||
# UUID string as result
|
||||
result = (None, False)
|
||||
|
||||
# Log about upload attempt
|
||||
utils.log_verbose(f"Uploading to {self.address} report: {json.dumps(report, indent=4)}")
|
||||
utils.log_verbose(f'Uploading to {self.address} report with audio duration: {report["duration"]}s, AQuA MOS: {round(report["mos_aqua"], 3)}')
|
||||
url = utils.join_host_and_path(self.address, "/probes/")
|
||||
|
||||
try:
|
||||
@@ -82,7 +82,7 @@ class QualtestBackend:
|
||||
|
||||
result = (r.content.decode().strip(), True)
|
||||
except Exception as e:
|
||||
utils.log_error(f"Upload report to {self.address} finished with error.", err=e)
|
||||
utils.log_error(f'Upload report to {self.address} finished with error: {str(e)}')
|
||||
# Backup probe result
|
||||
if cache is not None:
|
||||
probe_id = cache.add_report(report)
|
||||
|
||||
Reference in New Issue
Block a user