(q, b)
| 186 | |
| 187 | |
| 188 | def submit_task(q, b): |
| 189 | while True: |
| 190 | b.value = False |
| 191 | item = q.get() |
| 192 | logger.info(item) |
| 193 | b.value = True |
| 194 | if not item.pop('done', False): |
| 195 | delete_dir = item.pop('delete_dir', False) |
| 196 | output_dir = item.get('output_dir') |
| 197 | try: |
| 198 | push_to_hub(**item) |
| 199 | if delete_dir and os.path.exists(output_dir): |
| 200 | shutil.rmtree(output_dir) |
| 201 | except Exception as e: |
| 202 | logger.error(e) |
| 203 | else: |
| 204 | break |
| 205 | |
| 206 | |
| 207 | class UploadStrategy: |
nothing calls this directly
no test coverage detected
searching dependent graphs…