()
| 127 | processes.append(process) |
| 128 | |
| 129 | def read_input_to_queue(): |
| 130 | for path in paths: |
| 131 | print_rank_0(f"Start reading {path}") |
| 132 | with open(path) as file: |
| 133 | if self.split_row: |
| 134 | for row in file: |
| 135 | task_queue.put(row) |
| 136 | else: |
| 137 | items = json.load(file) |
| 138 | for item in items["RECORDS"]: |
| 139 | task_queue.put(item) |
| 140 | print_rank_0("Read input complete") |
| 141 | for i in range(len(processes)): |
| 142 | task_queue.put('STOP') |
| 143 | |
| 144 | process = Process(target=read_input_to_queue) |
| 145 | process.start() |
nothing calls this directly
no test coverage detected