Skip to content

Commit

Permalink
Increasing version
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush-cohere committed Jan 6, 2025
1 parent fe9440f commit 56c6502
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cohere/compass/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,21 @@ def imap_queued(
for x in it:
futures_set.add(executor.submit(f, x))
while len(futures_set) > max_queued:
done, not_done = futures.wait(
done, futures_set = futures.wait(
futures_set, return_when=futures.FIRST_COMPLETED
)
futures_set = not_done

for future in done:
try:
yield future.result()
except Exception as e:
logger.error(f"Error in processing file: {e}")
logger.exception(f"Error in processing file: {e}")

for future in futures.as_completed(futures_set):
try:
yield future.result()
except Exception as e:
logger.error(f"Error in processing file: {e}")
logger.exception(f"Error in processing file: {e}")


def get_fs(document_path: str) -> AbstractFileSystem:
Expand Down

0 comments on commit 56c6502

Please sign in to comment.