Skip to content

Commit

Permalink
[app][fix] respect kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
M3ssman committed Jun 10, 2024
1 parent eda27fe commit 8a81013
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli_oai_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,7 @@ def oai_arg_parser(value):
else:
LOGGER.error("[%s] update request failed: %s", PROCESS.process_identifier, status_code)
# finale
shutil.rmtree(req_dst_dir)
PROCESS.clear_resources(remove_metadata=True)
PROCESS.clear_resources(remove_all=True)
LOGGER.info("[%s] odem done in '%s' (%d executors)",
PROCESS.process_identifier, PROCESS.duration, EXECUTORS)
except o3o.ODEMNoTypeForOCRException as type_unknown:
Expand Down Expand Up @@ -423,7 +422,7 @@ def oai_arg_parser(value):
_notify(f'[OCR-D-ODEM] Failure for {rec_ident}', f'{err_dict}')
LOGGER.warning("[%s] remove working sub_dirs beneath '%s'",
PROCESS.process_identifier, LOCAL_WORK_ROOT)
PROCESS.clear_resources()
PROCESS.clear_resources(remove_all=True)
except VirtualMemoryExceededException as _vmem_exc:
err_dict = {'VirtualMemoryExceededException': _vmem_exc.args[0]}
LOGGER.error("[%s] odem fails with NotEnoughDiskSpaceException:"
Expand All @@ -432,6 +431,7 @@ def oai_arg_parser(value):
_notify(f'[OCR-D-ODEM] Failure for {rec_ident}', f'{err_dict}')
LOGGER.warning("[%s] remove working sub_dirs beneath '%s'",
PROCESS.process_identifier, LOCAL_WORK_ROOT)
PROCESS.clear_resources(remove_all=True)
except Exception as exc:
# pick whole error context, since some exception's args are
# rather mysterious, i.e. "13" for PermissionError
Expand Down

0 comments on commit 8a81013

Please sign in to comment.