Skip to content

Commit 240bd3c

Browse files
committed
Fix Pipedream metadata
1 parent aaf67cc commit 240bd3c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/dlstbx/wrapper/pipedream_xchem.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,11 @@ def save_dataset_metadata(
333333
output_yaml = {}
334334
output_yaml[dtag] = metadata
335335
json_file = f"{pipedream_dir}/Pipedream_output.json"
336+
if not os.path.exists(json_file):
337+
open(json_file, "w").close()
336338

337339
# Acquire a lock
338-
with portalocker.Lock(json_file, "a", timeout=5):
340+
with portalocker.Lock(json_file, timeout=5):
339341
if os.path.exists(json_file) and os.path.getsize(json_file) > 0:
340342
with open(json_file, "r", encoding="utf-8") as f:
341343
try:
@@ -344,6 +346,7 @@ def save_dataset_metadata(
344346
self.log.debug(
345347
f"Cannot continue with pipedream postprocessing: {e}"
346348
)
349+
return
347350
else:
348351
data = {}
349352

0 commit comments

Comments
 (0)