Skip to content

Commit c88e622

Browse files
Better check if input exists
1 parent 23fc6bf commit c88e622

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/run_service.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ class RunService:
1212
workflow_srv = WorkflowService()
1313

1414
def check_inputs(self, data_desc: DataDescriptor):
15+
ok = True
1516
for sub in data_desc.subjects:
1617
for key, value in data_desc.input.items():
1718
path = os.path.join(data_desc.data_path, value.replace('{subject_id}', sub))
1819
if not os.path.isfile(path):
1920
print(f"Input [{path}] does not exists")
20-
return False
21-
if os.path.getsize(path) == 0:
21+
ok = False
22+
elif os.path.getsize(path) == 0:
2223
print(f"Input [{path}] is empty")
23-
return False
24-
return True
24+
ok = False
25+
return ok
2526

2627
def run(self, data_desc: DataDescriptor, configs: List[dict], ref: Optional[dict]):
2728

0 commit comments

Comments
 (0)