Save with the same connection
Instead of 2 different connections, one for saving the flow detail and then one for saving the task detail just use one connection for both. Change-Id: I68315a6c201325bb154f5ab5fc69a3824055c912
This commit is contained in:
@@ -80,8 +80,13 @@ class Storage(object):
|
||||
td.state = states.PENDING
|
||||
td.version = task_version
|
||||
self._flowdetail.add(td)
|
||||
self._with_connection(self._save_flow_detail)
|
||||
self._with_connection(self._save_task_detail, task_detail=td)
|
||||
|
||||
def save_both(conn):
|
||||
"""Saves the flow and the task detail with the same connection"""
|
||||
self._save_flow_detail(conn)
|
||||
self._save_task_detail(conn, task_detail=td)
|
||||
|
||||
self._with_connection(save_both)
|
||||
|
||||
def _save_flow_detail(self, conn):
|
||||
# NOTE(harlowja): we need to update our contained flow detail if
|
||||
|
||||
Reference in New Issue
Block a user