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:
Joshua Harlow
2013-10-12 22:22:26 -07:00
parent faf2d155df
commit 7cf5734807

View File

@@ -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