Skip to content

Commit 66c9a27

Browse files
committed
reverting back to old code
1 parent 69585c4 commit 66c9a27

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

sofiax/merge.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ def sanity_check(flux: tuple, spatial_extent: tuple,
127127

128128

129129
async def match_merge_detections(conn, run: Run, instance: Instance, cwd: str):
130+
"""The database connection remains open for the duration of this
131+
process of merging and matching detections.
130132
133+
"""
131134
input_fits = instance.params['input.data']
132135
output_dir = instance.params['output.directory']
133136

@@ -275,21 +278,16 @@ async def match_merge_detections(conn, run: Run, instance: Instance, cwd: str):
275278
f"Not Resolved, Name: {detect_dict['name']}\
276279
Details: Setting to unresolved"
277280
)
278-
# Create tasks that are awaited upon together
279-
insert_task = db_detection_insert(
281+
await db_detection_insert(
280282
conn, run.run_id, instance.instance_id, detect_dict,
281283
cube_bytes, mask_bytes, mom0_bytes, mom1_bytes,
282284
mom2_bytes, chan_bytes, spec_bytes, True
283285
)
284-
update_detection_task = db_update_detection_unresolved(
286+
await db_update_detection_unresolved(
285287
conn,
286288
True,
287289
[i['id'] for i in result]
288290
)
289-
await asyncio.gather(
290-
insert_task,
291-
update_detection_task
292-
)
293291

294292

295293
async def run_merge(config, run_name, param_list, sanity):

0 commit comments

Comments
 (0)