Skip to content

Commit f322130

Browse files
committed
Suppress logging of average processing time if nothing was processed
This avoids a potential division by zero. Signed-off-by: Stefan Weil <[email protected]>
1 parent dae67b1 commit f322130

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

user_scripts/parse_folder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ def main():
334334

335335
if page_parser.decoder:
336336
logger.info(page_parser.decoder.decoding_summary())
337-
logger.info(f'AVERAGE PROCESSING TIME {(time.time() - t_start) / len(ids_to_process)}')
337+
if len(ids_to_process) > 0:
338+
logger.info(f'AVERAGE PROCESSING TIME {(time.time() - t_start) / len(ids_to_process)}')
338339

339340

340341
if __name__ == "__main__":

0 commit comments

Comments
 (0)