Skip to content

Commit

Permalink
code review: implement feedback on engine.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tarilabs committed Sep 5, 2023
1 parent c8d3f36 commit c7512df
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions ansible_rulebook/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,16 @@ async def monitor_rulebook(rulebook_file):
finally:
observer.stop()
observer.join()
raise HotReloadException(
"Rulebook file changed, "
+ "raising exception so to asyncio.FIRST_EXCEPTION "
+ "in order to reload"
)
# we need to check if the try-clause completed because
# while-loop terminated successfully, in such case we
# follow on the hot-reload use case, or if we got into
# this finally-clause because of other errors.
if event_handler.is_modified():
raise HotReloadException(
"Rulebook file changed, "
+ "raising exception so to asyncio.FIRST_EXCEPTION "
+ "in order to reload"
)


async def run_rulesets(
Expand Down

0 comments on commit c7512df

Please sign in to comment.