Skip to content

Commit

Permalink
Merge pull request #13 from black-cape/feature-support-async-processors
Browse files Browse the repository at this point in the history
Add support for async processors
  • Loading branch information
mdconaway committed May 12, 2023
2 parents d88ee83 + 9d9c511 commit 58183c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion etl/general_event_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,11 @@ def process_file(

success = True
try:
run_method(*(str(local_data_file), ), **method_kwargs)
import asyncio
if asyncio.iscoroutinefunction(run_method):
asyncio.run(run_method(*(str(local_data_file), ), **method_kwargs))
else:
run_method(*(str(local_data_file), ), **method_kwargs)
except Exception as e:
logger.error(f"Error response from configured processor {processor.python}: {e}")
success = False
Expand Down

0 comments on commit 58183c9

Please sign in to comment.