diff --git a/app.py b/app.py index 8b18bb3..c5fc304 100644 --- a/app.py +++ b/app.py @@ -210,6 +210,8 @@ def execute_http_function(function): response = requests.post(API_URL, json={'code': code, 'request': request_obj, 'environment': environment}) response_data = response.json() + db.update_http_function_environment_info(function, json.dumps(response_data['environment'])) + # Map the Node.js response to Flask response flask_response = map_isolator_response_to_flask_response(response_data) return flask_response diff --git a/db.py b/db.py index ad57dce..fab026c 100644 --- a/db.py +++ b/db.py @@ -63,6 +63,10 @@ class DataBase(): def edit_http_function(self, name, script_content, environment_info): self.execute( 'UPDATE http_functions SET script_content=%s, environment_info=%s WHERE NAME=%s', [script_content, environment_info, name], commit=True) + + def update_http_function_environment_info(self, name, environment_info): + self.execute( + 'UPDATE http_functions SET environment_info=%s WHERE NAME=%s', [environment_info, name], commit=True) def delete_http_function(self, name): self.execute(