Skip to content

Commit

Permalink
Sync with master
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan committed May 29, 2024
1 parent ca579c5 commit bde6d4f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions upsonic/remote/on_prem.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ def os_name(self):
else:
return 'Unknown OS'

def add_run_history(self, key, version, cpu_usage_one_core, memory_usage, elapsed_time, type, params):
def add_run_history(self, key, version, cpu_usage_one_core, memory_usage, elapsed_time, type, params, exception_log):
data = {
"scope": key,
"version": version,
Expand All @@ -979,7 +979,8 @@ def add_run_history(self, key, version, cpu_usage_one_core, memory_usage, elapse
"type": type,
"python_version":f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}",
"os_name": self.os_name(),
"params":json.dumps(params)
"params":json.dumps(params),
"exception_log":exception_log,
}

self._send_request("POST", "/dump_run", data)
Expand Down Expand Up @@ -1048,8 +1049,11 @@ def normalize_params(*args, **kwargs):
else:
the_version = version
the_type = "Succed" if succed else "Failed"
exception_log = None
if not succed:
exception_log = output
try:
self.add_run_history(key, the_version, cpu_usage_for_one_core, memory_used, total_time, the_type, the_params)
self.add_run_history(key, the_version, cpu_usage_for_one_core, memory_used, total_time, the_type, the_params, exception_log)
except:
self._log(f"Error on adding run history, for server not supported. {key}")
return output
Expand Down

0 comments on commit bde6d4f

Please sign in to comment.